Version: 2017.2
public string text ;

描述

输入字段的当前值。

请注意,对于 InputField.text,null 是无效值。

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

public class Example : MonoBehaviour { public InputField mainInputField;

public void Start() { mainInputField.text = "Enter Text Here..."; } }