Browse Source

Added hideSequenceObjects flag

master
chrisgregan 11 years ago
parent
commit
f570e9ab79
  1. BIN
      Assets/Example/Scenes/Example.unity
  2. 6
      Assets/Fungus/FungusScript/Editor/FungusScriptEditor.cs
  3. 11
      Assets/Fungus/FungusScript/Scripts/FungusScript.cs

BIN
Assets/Example/Scenes/Example.unity

Binary file not shown.

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

@ -14,6 +14,7 @@ namespace Fungus
SerializedProperty startSequenceProp;
SerializedProperty startAutomaticallyProp;
SerializedProperty colorCommandsProp;
SerializedProperty hideSequenceObjectsProp;
SerializedProperty variablesProp;
void OnEnable()
@ -22,6 +23,7 @@ namespace Fungus
startSequenceProp = serializedObject.FindProperty("startSequence");
startAutomaticallyProp = serializedObject.FindProperty("startAutomatically");
colorCommandsProp = serializedObject.FindProperty("colorCommands");
hideSequenceObjectsProp = serializedObject.FindProperty("hideSequenceObjects");
variablesProp = serializedObject.FindProperty("variables");
}
@ -36,6 +38,8 @@ namespace Fungus
FungusScript t = target as FungusScript;
t.UpdateHideFlags();
if (Application.isPlaying)
{
if (t.executingSequence == null)
@ -66,6 +70,8 @@ namespace Fungus
EditorGUILayout.PropertyField(colorCommandsProp, new GUIContent("Color Commands", "Display commands using colors in editor window."));
EditorGUILayout.PropertyField(hideSequenceObjectsProp, new GUIContent("Hide Sequence Objects", "Hides the Sequence game objects in the hierarchy view."));
EditorGUILayout.Separator();
GUILayout.BeginHorizontal();

11
Assets/Fungus/FungusScript/Scripts/FungusScript.cs

@ -45,6 +45,8 @@ namespace Fungus
public bool colorCommands = true;
public bool hideSequenceObjects = true;
public List<Variable> variables = new List<Variable>();
void Start()
@ -132,6 +134,15 @@ namespace Fungus
}
}
}
public void UpdateHideFlags()
{
Sequence[] sequences = GetComponentsInChildren<Sequence>();
foreach (Sequence sequence in sequences)
{
sequence.gameObject.hideFlags = hideSequenceObjects ? HideFlags.HideInHierarchy : HideFlags.None;
}
}
}
}
Loading…
Cancel
Save