diff --git a/Assets/Example/Scenes/Example.unity b/Assets/Example/Scenes/Example.unity index caf5b82c..9a248536 100644 Binary files a/Assets/Example/Scenes/Example.unity and b/Assets/Example/Scenes/Example.unity differ diff --git a/Assets/Fungus/FungusScript/Editor/FungusScriptEditor.cs b/Assets/Fungus/FungusScript/Editor/FungusScriptEditor.cs index aefe5caa..a11d52be 100644 --- a/Assets/Fungus/FungusScript/Editor/FungusScriptEditor.cs +++ b/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(); diff --git a/Assets/Fungus/FungusScript/Scripts/FungusScript.cs b/Assets/Fungus/FungusScript/Scripts/FungusScript.cs index 69b92662..b962997a 100644 --- a/Assets/Fungus/FungusScript/Scripts/FungusScript.cs +++ b/Assets/Fungus/FungusScript/Scripts/FungusScript.cs @@ -45,6 +45,8 @@ namespace Fungus public bool colorCommands = true; + public bool hideSequenceObjects = true; + public List variables = new List(); void Start() @@ -132,6 +134,15 @@ namespace Fungus } } } + + public void UpdateHideFlags() + { + Sequence[] sequences = GetComponentsInChildren(); + foreach (Sequence sequence in sequences) + { + sequence.gameObject.hideFlags = hideSequenceObjects ? HideFlags.HideInHierarchy : HideFlags.None; + } + } } } \ No newline at end of file