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 startSequenceProp;
SerializedProperty startAutomaticallyProp; SerializedProperty startAutomaticallyProp;
SerializedProperty colorCommandsProp; SerializedProperty colorCommandsProp;
SerializedProperty hideSequenceObjectsProp;
SerializedProperty variablesProp; SerializedProperty variablesProp;
void OnEnable() void OnEnable()
@ -22,6 +23,7 @@ namespace Fungus
startSequenceProp = serializedObject.FindProperty("startSequence"); startSequenceProp = serializedObject.FindProperty("startSequence");
startAutomaticallyProp = serializedObject.FindProperty("startAutomatically"); startAutomaticallyProp = serializedObject.FindProperty("startAutomatically");
colorCommandsProp = serializedObject.FindProperty("colorCommands"); colorCommandsProp = serializedObject.FindProperty("colorCommands");
hideSequenceObjectsProp = serializedObject.FindProperty("hideSequenceObjects");
variablesProp = serializedObject.FindProperty("variables"); variablesProp = serializedObject.FindProperty("variables");
} }
@ -36,6 +38,8 @@ namespace Fungus
FungusScript t = target as FungusScript; FungusScript t = target as FungusScript;
t.UpdateHideFlags();
if (Application.isPlaying) if (Application.isPlaying)
{ {
if (t.executingSequence == null) 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(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(); EditorGUILayout.Separator();
GUILayout.BeginHorizontal(); GUILayout.BeginHorizontal();

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

@ -45,6 +45,8 @@ namespace Fungus
public bool colorCommands = true; public bool colorCommands = true;
public bool hideSequenceObjects = true;
public List<Variable> variables = new List<Variable>(); public List<Variable> variables = new List<Variable>();
void Start() 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