void Start() { //ソフトウェアキーボードの初期化 Swkbd.Initialize(ref showKeyboardArg, false); inputText.text = ""; blackImage.color = new Color(0, 0, 0, 0); }
/// <summary> /// キーボードの表示 /// </summary> void ShowKeyboard() { //キーボードの設定の初期化 Swkbd.InitializeKeyboardConfig(ref showKeyboardArg.keyboardConfig); //テキストの初期化(ここでは空で初期化する) Swkbd.SetInitialText(ref showKeyboardArg, ""); //テキストのサイズを設定 showKeyboardArg.keyboardConfig.textMinLength = MinLength; showKeyboardArg.keyboardConfig.textMaxLength = MaxLength; System.Text.StringBuilder resultString = new System.Text.StringBuilder(Swkbd.TextMaxLength); //キーボードを表示し、その間MainThreadは停止する var result = Swkbd.ShowKeyboard(resultString, showKeyboardArg, true); if (result.IsSuccess()) { //結果をUIに表示 inputText.text = resultString.ToString(); } }
void OnDestroy() { Swkbd.Destroy(ref showKeyboardArg); }