Version: 2023.1
Method group is Obsolete

TouchScreenKeyboard.done

切换到手册
Obsolete public bool done ;

描述

指定输入过程是否已完成。(只读)

用户可以通过点击“Done” 按钮或以脚本方式将 active 属性设置为 false 来完成键盘输入过程。请注意,键盘 可能暂时停用(通过由方向更改造成的 滑入/滑出或通过其他键盘的显示),但其 输入过程可能仍未完成并将自动 继续。

using UnityEngine;

public class Example : MonoBehaviour { // Opens a keyboard and shows what has been typed.

TouchScreenKeyboard keyboard; public string text = "";

void Start() { keyboard = TouchScreenKeyboard.Open(text, TouchScreenKeyboardType.Default); }

void Update() { if (keyboard != null && keyboard.status == TouchScreenKeyboard.Status.Done) { text = keyboard.text; print("User input is: " + text); } } }