-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
- Kanji conversion system thanks to the Google CGI API for Japanese Input. - OnJPInput(string) is called when kanji is confirmed. - OnBackspace() is called when B button is pressed and when conversion area is empty.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using UnityEngine; | ||
using System.Collections; | ||
|
||
public class CaptureScreenshot : MonoBehaviour { | ||
|
||
void Update () { | ||
if (Input.GetKeyDown (KeyCode.Space)) { | ||
Application.CaptureScreenshot ("image.png"); | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using UnityEngine; | ||
using System.Collections; | ||
using UnityEngine.SceneManagement; | ||
|
||
public class TextInputSample : MonoBehaviour { | ||
|
||
[SerializeField] TextMesh textMesh; | ||
|
||
//漢字変換後の入力を受け取るサンプルです。 | ||
//OnJPInput(string) は漢字変換を確定するたびにコールされ、 | ||
//確定した文字列を引数として取得できます。 | ||
void OnJPInput (string str) { | ||
textMesh.text += str; | ||
} | ||
|
||
//後ろの文字を消去します。仮。デリゲートでコールバックに変更する予定。 | ||
void OnBackspace () { | ||
textMesh.text = textMesh.text.Remove (textMesh.text.Length - 1, 1); | ||
} | ||
|
||
void Update () { | ||
//シーンのリロード。入力とは関係ありません。 | ||
if (OVRInput.GetDown (OVRInput.RawButton.RThumbstick)) | ||
SceneManager.LoadScene ("Example"); | ||
|
||
//19文字を超えないように調整 | ||
if (textMesh.text.Length > 19) { | ||
textMesh.text = textMesh.text.Remove (0, 1); | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.