public static bool ToggleLeft (Rect position, string label, bool value, GUIStyle labelStyle= EditorStyles.label);
public static bool ToggleLeft (Rect position, GUIContent label, bool value, GUIStyle labelStyle= EditorStyles.label);

Parameters

position屏幕上用于开关的矩形。
label显示在开关旁的标签。
value要编辑的值。
labelStyle(可选)用于标签的 GUIStyle

Returns

bool 用户设置的值。

Description

Makes a toggle field where the toggle is to the left and the label immediately to the right of it.

EditorGUI.ToggleLeftGUI.Toggle 类似,但遵循 EditorGUI.showMixedValue 属性并处理与其他编辑器控件一致的键盘焦点。