Browse Source

Highlight executing command

master
chrisgregan 11 years ago
parent
commit
8450caf0b1
  1. 29
      Assets/Fungus/Editor/FungusScript/FungusCommandEditor.cs
  2. BIN
      Assets/Shuttle/ShuttleGame.unity

29
Assets/Fungus/Editor/FungusScript/FungusCommandEditor.cs

@ -25,6 +25,8 @@ namespace Fungus.Script
{ {
FungusCommand t = target as FungusCommand; FungusCommand t = target as FungusCommand;
GUILayout.BeginVertical();
GUILayout.BeginHorizontal(); GUILayout.BeginHorizontal();
t.expanded = EditorGUILayout.Foldout(t.expanded, t.GetType().Name); t.expanded = EditorGUILayout.Foldout(t.expanded, t.GetType().Name);
@ -38,6 +40,15 @@ namespace Fungus.Script
if (!t.expanded) if (!t.expanded)
{ {
GUILayout.EndVertical();
if (Event.current.type == EventType.Repaint &&
t.IsExecuting())
{
Rect rect = GUILayoutUtility.GetLastRect();
rect.x -= 10;
rect.width += 10;
GLDraw.DrawBox(rect, Color.green, 1.5f);
}
return; return;
} }
@ -96,17 +107,17 @@ namespace Fungus.Script
style.normal.textColor = new Color(1,0,0); style.normal.textColor = new Color(1,0,0);
EditorGUILayout.LabelField(new GUIContent("Error: " + t.errorMessage), style); EditorGUILayout.LabelField(new GUIContent("Error: " + t.errorMessage), style);
} }
/*
if (t.IsExecuting())
{
EditorGUI.DrawRect(rect, new Color(0f, 1f, 0f, 0.25f));
} }
else if (t == selectedCommand)
GUILayout.EndVertical();
if (Event.current.type == EventType.Repaint &&
t.IsExecuting())
{ {
EditorGUI.DrawRect(rect, new Color(1f, 1f, 0f, 0.25f)); Rect rect = GUILayoutUtility.GetLastRect();
} rect.x -= 10;
*/ rect.width += 10;
GLDraw.DrawBox(rect, Color.green, 1.5f);
} }
} }

BIN
Assets/Shuttle/ShuttleGame.unity

Binary file not shown.
Loading…
Cancel
Save