Browse Source

Command buttons remember if they've been expanded

master
chrisgregan 11 years ago
parent
commit
18e2b11716
  1. 11
      Assets/Fungus/Editor/FungusScript/SequenceEditor.cs
  2. 3
      Assets/Fungus/VisualScripting/FungusCommand.cs
  3. BIN
      Assets/Shuttle/ShuttleGame.unity

11
Assets/Fungus/Editor/FungusScript/SequenceEditor.cs

@ -97,17 +97,10 @@ namespace Fungus.Script
if (GUILayout.Button(command.GetCommandTitle())) if (GUILayout.Button(command.GetCommandTitle()))
{ {
if (activeCommand == command) command.expanded = !command.expanded;
{
activeCommand = null;
}
else
{
activeCommand = command;
}
} }
if (showCommandInspector) if (command.expanded)
{ {
Editor commandEditor = Editor.CreateEditor(command); Editor commandEditor = Editor.CreateEditor(command);
commandEditor.OnInspectorGUI(); commandEditor.OnInspectorGUI();

3
Assets/Fungus/VisualScripting/FungusCommand.cs

@ -19,6 +19,9 @@ namespace Fungus.Script
[HideInInspector] [HideInInspector]
public Sequence parentSequence; public Sequence parentSequence;
[HideInInspector]
public bool expanded;
public virtual void Start() public virtual void Start()
{ {
parentSequence = GetComponent<Sequence>(); parentSequence = GetComponent<Sequence>();

BIN
Assets/Shuttle/ShuttleGame.unity

Binary file not shown.
Loading…
Cancel
Save