Created
May 28, 2014 03:44
-
-
Save masayuki5160/bf48ae8eab25ae539290 to your computer and use it in GitHub Desktop.
Unityでのキーボード入力. iPhone上ではテストした. Androidは???
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public class usageExample : MonoBehaviour { | |
private TouchScreenKeyboard keyboard; | |
void Start () { | |
keyboard = TouchScreenKeyboard.Open("your name", TouchScreenKeyboardType.Default); | |
} | |
void Update(){ | |
if(keyboard.done){ | |
// 入力完了時によばれる. | |
Debug.Log("name fixed:" + keyboard.text); | |
} | |
} | |
void OnGUI() { | |
GUILayout.Label(keyboard.text); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
【参考】
http://docs.unity3d.com/ScriptReference/TouchScreenKeyboard.Open.html
http://docs-jp.unity3d.com/Documentation/Manual/MobileKeyboard.html