From b799534f9e48892c82cb01ce1db28154a2a1a45c Mon Sep 17 00:00:00 2001 From: chrisgregan Date: Thu, 4 Sep 2014 13:05:49 +0100 Subject: [PATCH] Enable / disable commands by clicking button in inspector --- .../Fungus/FungusScript/Editor/FungusCommandEditor.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Assets/Fungus/FungusScript/Editor/FungusCommandEditor.cs b/Assets/Fungus/FungusScript/Editor/FungusCommandEditor.cs index c65904a1..a59c1ffd 100644 --- a/Assets/Fungus/FungusScript/Editor/FungusCommandEditor.cs +++ b/Assets/Fungus/FungusScript/Editor/FungusCommandEditor.cs @@ -67,11 +67,17 @@ namespace Fungus.Script { GUI.backgroundColor = Color.grey; } - GUILayout.Label(commandName, commandStyle, GUILayout.MinWidth(80), GUILayout.ExpandWidth(true)); + + bool enabled = t.enabled; + + if (GUILayout.Button(commandName, commandStyle, GUILayout.MinWidth(80), GUILayout.ExpandWidth(true))) + { + enabled = !enabled; + } GUI.backgroundColor = Color.white; + enabled = GUILayout.Toggle(enabled, new GUIContent()); - bool enabled = GUILayout.Toggle(t.enabled, new GUIContent()); if (t.enabled != enabled) { Undo.RecordObject(t, "Set Enabled");