Browse Source

Enable / disable commands by clicking button in inspector

master
chrisgregan 10 years ago
parent
commit
b799534f9e
  1. 10
      Assets/Fungus/FungusScript/Editor/FungusCommandEditor.cs

10
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");

Loading…
Cancel
Save