Skip to content

Instantly share code, notes, and snippets.

@masayuki5160
Created May 28, 2014 03:44
Show Gist options
  • Save masayuki5160/bf48ae8eab25ae539290 to your computer and use it in GitHub Desktop.
Save masayuki5160/bf48ae8eab25ae539290 to your computer and use it in GitHub Desktop.
Unityでのキーボード入力. iPhone上ではテストした. Androidは???
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