iPhoneKeyboard.done 完成

var done : bool

Description描述

Specifies if input process was finished (Read Only)

输入过程是否结束(只读)。

Keyboard input process can be finished either by user tapping "Done" button or script setting active property to false. Note that keyboard might be temporarily inactive (either by sliding in/out due to orientation change or by appearance of another keyboard) however it's input process might still be not finished and will be resumed automatically.

键盘输入的过程的完成可以通过用户点击"Done"按钮或者脚本设置active属性成false两种方式。注意键盘可能暂时不激活(滑入/滑出因为方向的改变或者其他键盘的显示)然而输入过程并没有结束而且将会自动恢复。

// Opens a keyboard and shows what has been typed.
//打开一个键盘并且显示打字的内容

private var keyboard : iPhoneKeyboard;
var iPhoneText : String = "";

function Start() {
	keyboard = iPhoneKeyboard.Open(iPhoneText, iPhoneKeyboardType.Default);
}
function Update() {
	if (keyboard.done)
		print ("User input is: " + iPhoneText);
	if(keyboard)
		iPhoneText = keyboard.text;
}
最后修改:2011年4月8日 Friday 15:29

本脚本参考基于Unity 3.4.1f5

英文部分版权属©Unity公司所有,中文部分© Unity圣典 版权所有,未经许可,严禁转载 。