Browse Source

Green bar behind command inspector title

master
chrisgregan 11 years ago
parent
commit
6f8649f758
  1. 27
      Assets/Fungus/FungusScript/Editor/FungusCommandEditor.cs
  2. 2
      Assets/Fungus/FungusScript/Editor/FungusCommandListAdaptor.cs
  3. BIN
      Assets/Shuttle/ShuttleGame.unity

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

@ -46,18 +46,17 @@ namespace Fungus.Script
FungusScript fungusScript = t.GetFungusScript();
GUILayout.BeginVertical(GUI.skin.box);
GUILayout.BeginHorizontal();
CommandInfoAttribute commandInfoAttr = FungusCommandEditor.GetCommandInfo(t.GetType());
if (commandInfoAttr == null)
{
GUILayout.EndHorizontal();
GUILayout.EndVertical();
return;
}
GUILayout.BeginVertical(GUI.skin.box);
GUI.backgroundColor = Color.green;
GUILayout.BeginHorizontal(GUI.skin.box);
string commandName = commandInfoAttr.CommandName;
GUIStyle commandStyle = new GUIStyle(GUI.skin.button);
if (t.enabled)
@ -69,6 +68,7 @@ namespace Fungus.Script
GUI.backgroundColor = Color.grey;
}
GUILayout.Label(commandName, commandStyle, GUILayout.MinWidth(80), GUILayout.ExpandWidth(true));
GUI.backgroundColor = Color.white;
bool enabled = GUILayout.Toggle(t.enabled, new GUIContent());
@ -83,22 +83,11 @@ namespace Fungus.Script
if (GUILayout.Button("Copy", EditorStyles.miniButton))
{
fungusScript.copyCommand = t;
}
if (fungusScript.copyCommand != null)
{
if (GUILayout.Button("Paste", EditorStyles.miniButton))
{
Sequence parentSequence = t.GetComponent<Sequence>();
if (parentSequence != null)
{
PasteCommand(fungusScript.copyCommand, parentSequence);
}
}
}
}
}
GUILayout.EndHorizontal();
GUI.backgroundColor = Color.white;
EditorGUILayout.Separator();

2
Assets/Fungus/FungusScript/Editor/FungusCommandListAdaptor.cs

@ -157,7 +157,7 @@ namespace Fungus.Script
indentRect.width = indentSize + 1;
indentRect.y -= 2;
indentRect.height += 5;
GUI.backgroundColor = new Color(0.8f, 0.8f, 0.8f, 0.25f);
GUI.backgroundColor = new Color(0.5f, 0.5f, 0.5f, 0.5f);
GUI.Box(indentRect, "");
}

BIN
Assets/Shuttle/ShuttleGame.unity

Binary file not shown.
Loading…
Cancel
Save