Browse Source

Added command numbering

master
chrisgregan 11 years ago
parent
commit
2415632992
  1. 6
      Assets/Fungus/Editor/FungusScript/FungusCommandEditor.cs
  2. 5
      Assets/Fungus/Editor/FungusScript/FungusScriptEditor.cs

6
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)
{

5
Assets/Fungus/Editor/FungusScript/FungusScriptEditor.cs

@ -164,10 +164,11 @@ namespace Fungus.Script
EditorGUILayout.PrefixLabel("Commands");
FungusCommand[] commands = sequence.GetComponents<FungusCommand>();
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++);
}
}

Loading…
Cancel
Save