Version: 2021.3

GUISettings.doubleClickSelectsWord

切换到手册
public bool doubleClickSelectsWord ;

描述

在文本字段中双击是否应该选择单词。

默认设置为 true。

using UnityEngine;

public class Example : MonoBehaviour { string str = "This is a string with \n two lines of text";

void OnGUI() { GUI.skin.settings.doubleClickSelectsWord = false; str = GUILayout.TextArea(str); } }