diff --git a/Assets/Fungus/Editor/FungusScript/FungusCommandEditor.cs b/Assets/Fungus/Editor/FungusScript/FungusCommandEditor.cs index 5e7451c2..d05b3d9a 100644 --- a/Assets/Fungus/Editor/FungusScript/FungusCommandEditor.cs +++ b/Assets/Fungus/Editor/FungusScript/FungusCommandEditor.cs @@ -21,7 +21,7 @@ namespace Fungus.Script } } - public override void OnInspectorGUI() + public virtual void DrawInspectorGUI(int commandIndex) { FungusCommand t = target as FungusCommand; @@ -34,7 +34,9 @@ namespace Fungus.Script GUILayout.BeginHorizontal(); - bool expanded = EditorGUILayout.Foldout(t.expanded, t.GetType().Name); + string commandLabel = commandIndex.ToString() + " " + t.GetType().Name; + + bool expanded = EditorGUILayout.Foldout(t.expanded, commandLabel); if (expanded != t.expanded) { diff --git a/Assets/Fungus/Editor/FungusScript/FungusScriptEditor.cs b/Assets/Fungus/Editor/FungusScript/FungusScriptEditor.cs index 26ed89eb..bd05f7e8 100644 --- a/Assets/Fungus/Editor/FungusScript/FungusScriptEditor.cs +++ b/Assets/Fungus/Editor/FungusScript/FungusScriptEditor.cs @@ -164,10 +164,11 @@ namespace Fungus.Script EditorGUILayout.PrefixLabel("Commands"); FungusCommand[] commands = sequence.GetComponents(); + int index = 1; foreach (FungusCommand command in commands) { - Editor commandEditor = Editor.CreateEditor(command); - commandEditor.OnInspectorGUI(); + FungusCommandEditor commandEditor = Editor.CreateEditor(command) as FungusCommandEditor; + commandEditor.DrawInspectorGUI(index++); } }