diff --git a/Assets/Fungus/Editor/FungusScript/FungusEditorWindow.cs b/Assets/Fungus/Editor/FungusScript/FungusEditorWindow.cs index 960b40df..2eff68da 100755 --- a/Assets/Fungus/Editor/FungusScript/FungusEditorWindow.cs +++ b/Assets/Fungus/Editor/FungusScript/FungusEditorWindow.cs @@ -100,7 +100,7 @@ namespace Fungus.Script for (int i = 0; i < sequences.Length; ++i) { Sequence sequence = sequences[i]; - + float titleWidth = windowStyle.CalcSize(new GUIContent(sequence.name)).x; float windowWidth = Mathf.Max (titleWidth + 10, 100); @@ -115,6 +115,7 @@ namespace Fungus.Script } sequence.nodeRect = GUILayout.Window(i, sequence.nodeRect, DrawWindow, sequence.name, GUILayout.Width(windowWidth), GUILayout.Height(20), GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true)); + windowSequenceMap.Add(sequence); } diff --git a/Assets/Fungus/Editor/FungusScript/FungusScriptEditor.cs b/Assets/Fungus/Editor/FungusScript/FungusScriptEditor.cs index ac6782eb..de04dac0 100644 --- a/Assets/Fungus/Editor/FungusScript/FungusScriptEditor.cs +++ b/Assets/Fungus/Editor/FungusScript/FungusScriptEditor.cs @@ -19,6 +19,12 @@ namespace Fungus.Script { variablesProperty = serializedObject.FindProperty("variables"); } + + FungusScript t = target as FungusScript; + if (t != null) + { + t.transform.hideFlags = HideFlags.HideInInspector; + } } public void OnInspectorUpdate() @@ -31,17 +37,7 @@ namespace Fungus.Script serializedObject.Update(); FungusScript t = target as FungusScript; - - GUILayout.BeginHorizontal(); - GUILayout.FlexibleSpace(); - if (GUILayout.Button("Open Fungus Editor")) - { - EditorWindow.GetWindow(typeof(FungusEditorWindow), false, "Fungus Editor"); - } - GUILayout.FlexibleSpace(); - GUILayout.EndHorizontal(); - GUIContent stepTimeLabel = new GUIContent("Step Time", "Minimum time to execute each step"); t.stepTime = EditorGUILayout.FloatField(stepTimeLabel, t.stepTime); @@ -58,6 +54,15 @@ namespace Fungus.Script GUIContent startAutomaticallyLabel = new GUIContent("Start Automatically", "Start this Fungus Script when the scene starts."); t.startAutomatically = EditorGUILayout.Toggle(startAutomaticallyLabel, t.startAutomatically); + GUILayout.BeginHorizontal(); + GUILayout.FlexibleSpace(); + if (GUILayout.Button("Open Fungus Editor")) + { + EditorWindow.GetWindow(typeof(FungusEditorWindow), false, "Fungus Editor"); + } + GUILayout.FlexibleSpace(); + GUILayout.EndHorizontal(); + EditorGUILayout.Separator(); GUILayout.Box("Sequence Editor", GUILayout.ExpandWidth(true)); @@ -67,6 +72,7 @@ namespace Fungus.Script { GameObject go = new GameObject("Sequence"); go.transform.parent = t.transform; + go.transform.hideFlags = HideFlags.HideInHierarchy; Sequence s = go.AddComponent(); FungusEditorWindow fungusEditorWindow = EditorWindow.GetWindow(typeof(FungusEditorWindow), false, "Fungus Editor") as FungusEditorWindow; s.nodeRect.x = fungusEditorWindow.scrollPos.x; @@ -87,6 +93,7 @@ namespace Fungus.Script { GameObject copy = GameObject.Instantiate(t.selectedSequence.gameObject) as GameObject; copy.transform.parent = t.transform; + copy.transform.hideFlags = HideFlags.HideInHierarchy; copy.name = t.selectedSequence.name; Sequence sequenceCopy = copy.GetComponent(); diff --git a/Assets/Fungus/Editor/FungusScript/SequenceEditor.cs b/Assets/Fungus/Editor/FungusScript/SequenceEditor.cs index 928de16a..3bb10186 100644 --- a/Assets/Fungus/Editor/FungusScript/SequenceEditor.cs +++ b/Assets/Fungus/Editor/FungusScript/SequenceEditor.cs @@ -49,66 +49,6 @@ namespace Fungus.Script return result; } - - public override bool RequiresConstantRepaint() - { - return true; - } - - public override void OnInspectorGUI() - { - Sequence t = target as Sequence; - - EditorGUILayout.PrefixLabel(new GUIContent("Description", "Sequence description displayed in editor window")); - - string description = GUILayout.TextArea(t.description, GUILayout.ExpandWidth(true)); - if (description != t.description) - { - Undo.RecordObject(t, "Set Description"); - t.description = description; - } - - FungusCommand[] commands = t.GetComponents(); - - /* - if (Application.isPlaying) - { - foreach (FungusCommand command in commands) - { - if (command == FungusCommandEditor.selectedCommand) - { - activeCommand = command; - Debug.Log("Found it"); - } - } - } - */ - - EditorGUILayout.PrefixLabel("Commands"); - - foreach (FungusCommand command in commands) - { - /* - bool showCommandInspector = false; - if (command == activeCommand || - command.IsExecuting()) - { - showCommandInspector = true; - } - */ - - if (GUILayout.Button(command.GetCommandTitle())) - { - command.expanded = !command.expanded; - } - - if (command.expanded) - { - Editor commandEditor = Editor.CreateEditor(command); - commandEditor.OnInspectorGUI(); - } - } - } } } \ No newline at end of file diff --git a/Assets/Fungus/VisualScripting/FungusScript.cs b/Assets/Fungus/VisualScripting/FungusScript.cs index 2750e3a8..0e9ea2cc 100644 --- a/Assets/Fungus/VisualScripting/FungusScript.cs +++ b/Assets/Fungus/VisualScripting/FungusScript.cs @@ -24,7 +24,6 @@ namespace Fungus.Script public List variables = new List(); - void Start() { if (startAutomatically) diff --git a/Assets/Fungus/VisualScripting/Sequence.cs b/Assets/Fungus/VisualScripting/Sequence.cs index 99540a0b..febe58be 100644 --- a/Assets/Fungus/VisualScripting/Sequence.cs +++ b/Assets/Fungus/VisualScripting/Sequence.cs @@ -13,7 +13,7 @@ namespace Fungus.Script { [HideInInspector] public Rect nodeRect = new Rect(10, 10, 100, 100); - + [HideInInspector] public string description = ""; @@ -24,7 +24,7 @@ namespace Fungus.Script public FungusCommand activeCommand; int executionCount; - + public virtual void Start() { fungusScript = GetFungusScript(); diff --git a/Assets/Shuttle/ShuttleGame.unity b/Assets/Shuttle/ShuttleGame.unity index d9eccb36..416b784d 100644 Binary files a/Assets/Shuttle/ShuttleGame.unity and b/Assets/Shuttle/ShuttleGame.unity differ