GuiEnabledStateScope Class |
Namespace: KSPDev.GUIUtils
The GuiEnabledStateScope type exposes the following members.
Name | Description | |
---|---|---|
![]() ![]() | GuiEnabledStateScope | Stores the old state and sets a new one. |
void OnGUI() { GUI.enabled = true; using (new GuiEnabledStateScope(false)) { // All the controls in this block will become disabled. GUILayout.Button("Disabled button 1"); GUILayout.Button("Disabled button 2"); } // From here the enabled state is True again. GUILayout.Button("Enabled button 3"); }