InputField.DeactivateInputField

切换到手册
public void DeactivateInputField ();

描述

用于停用 InputField 以停止处理 Events 的函数,并且如果未取消,则发送 OnSubmit。

using UnityEngine;
using System.Collections;
using UnityEngine.UI; // Required when Using UI elements.

public class Example : MonoBehaviour { public InputField mainInputField;

// Deactivates the main input field when the scene starts. void Start() { mainInputField.DeactivateInputField(); } }