diff --git a/Assets/Fungus/Editor/FungusScript/FungusEditorWindow.cs b/Assets/Fungus/Editor/FungusScript/FungusEditorWindow.cs index 2654bb1d..1ba9d4ba 100755 --- a/Assets/Fungus/Editor/FungusScript/FungusEditorWindow.cs +++ b/Assets/Fungus/Editor/FungusScript/FungusEditorWindow.cs @@ -98,7 +98,17 @@ namespace Fungus.Script float titleWidth = windowStyle.CalcSize(new GUIContent(sequence.name)).x; float windowWidth = Mathf.Max (titleWidth + 10, 100); - sequence.nodeRect = GUILayout.Window(i, sequence.nodeRect, DrawWindow, sequence.name, GUILayout.Width(windowWidth), GUILayout.Height(40), GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true)); + if (Selection.activeGameObject == sequence.gameObject) + { + Rect outlineRect = sequence.nodeRect; + outlineRect.width += 10; + outlineRect.x -= 5; + outlineRect.height += 10; + outlineRect.y -= 5; + GLDraw.DrawBox(outlineRect, Color.green, 2); + } + + 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); } @@ -172,6 +182,7 @@ namespace Fungus.Script } } + /* if (FungusCommandEditor.selectedCommand != null) { if (Selection.activeGameObject == null) @@ -191,14 +202,24 @@ namespace Fungus.Script } } } + */ Sequence sequence = windowSequenceMap[windowId]; - string description = GUILayout.TextArea(sequence.description, GUILayout.ExpandWidth(true)); - if (description != sequence.description) + if (!Application.isPlaying && sequence.gameObject == Selection.activeGameObject) + { + string description = GUILayout.TextArea(sequence.description, GUILayout.ExpandWidth(true)); + if (description != sequence.description) + { + Undo.RecordObject(sequence, "Set Description"); + sequence.description = description; + } + } + else { - Undo.RecordObject(sequence, "Set Description"); - sequence.description = description; + GUIStyle labelStyle = new GUIStyle(GUI.skin.label); + labelStyle.wordWrap = true; + GUILayout.Label(sequence.description, labelStyle); } /* @@ -244,7 +265,7 @@ namespace Fungus.Script } */ - GUILayout.Space(10); + GUILayout.Space(1); GUI.DragWindow(); } diff --git a/Assets/Fungus/Editor/FungusScript/FungusScriptEditor.cs b/Assets/Fungus/Editor/FungusScript/FungusScriptEditor.cs index f7c2782b..73efe6ce 100644 --- a/Assets/Fungus/Editor/FungusScript/FungusScriptEditor.cs +++ b/Assets/Fungus/Editor/FungusScript/FungusScriptEditor.cs @@ -15,7 +15,10 @@ namespace Fungus.Script void OnEnable() { - variablesProperty = serializedObject.FindProperty("variables"); + if (serializedObject != null) + { + variablesProperty = serializedObject.FindProperty("variables"); + } } public void OnInspectorUpdate() diff --git a/Assets/Fungus/Editor/FungusScript/SequenceEditor.cs b/Assets/Fungus/Editor/FungusScript/SequenceEditor.cs index 43dfc3be..d6038d15 100644 --- a/Assets/Fungus/Editor/FungusScript/SequenceEditor.cs +++ b/Assets/Fungus/Editor/FungusScript/SequenceEditor.cs @@ -55,17 +55,19 @@ namespace Fungus.Script return true; } - /* - public void OnInspectorUpdate() - { - Repaint(); - } - */ - 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(); /* @@ -82,6 +84,8 @@ namespace Fungus.Script } */ + EditorGUILayout.PrefixLabel("Commands"); + foreach (FungusCommand command in commands) { bool showCommandInspector = false; diff --git a/Assets/Shuttle/ShuttleGame.unity b/Assets/Shuttle/ShuttleGame.unity index 1f55a733..dafaed1e 100644 Binary files a/Assets/Shuttle/ShuttleGame.unity and b/Assets/Shuttle/ShuttleGame.unity differ