Version: 2023.2
public GUIStyle textField ;

描述

GUI.TextField 控件默认使用的样式。

using UnityEngine;

public class Example : MonoBehaviour { // Modifies only the textField style of the current GUISkin

GUIStyle style; string str = "A string...";

void OnGUI() { GUI.skin.textField = style; str = GUILayout.TextField(str); } }