Version: 2021.2

GUISettings.tripleClickSelectsLine

切换到手册
public bool tripleClickSelectsLine ;

描述

在文本字段中单击三次是否应该选择全部文本。

默认设置为 true。

using UnityEngine;

public class Example : MonoBehaviour { // Disables line selecting with triple click on the text area string str = "This is a string with \n two lines of text";

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