diff --git a/Assets/Fungus/Editor/AddOptionCommandEditor.cs b/Assets/Fungus/Editor/AddOptionCommandEditor.cs index 374b227b..2f2e3ec4 100644 --- a/Assets/Fungus/Editor/AddOptionCommandEditor.cs +++ b/Assets/Fungus/Editor/AddOptionCommandEditor.cs @@ -1,4 +1,4 @@ -using UnityEditor; +using UnityEditor; using UnityEditorInternal; using UnityEngine; using System.Collections; @@ -7,12 +7,12 @@ using System.Collections.Generic; namespace Fungus.Script { - [CustomEditor (typeof(AddOptionCommand))] + [CustomEditor (typeof(AddOption))] public class AddOptionCommandEditor : FungusCommandEditor { public override void DrawCommandInspectorGUI() { - AddOptionCommand t = target as AddOptionCommand; + AddOption t = target as AddOption; EditorGUI.BeginChangeCheck(); @@ -20,7 +20,7 @@ namespace Fungus.Script Sequence newSequence = SequenceEditor.SequenceField(new GUIContent("Sequence", "Sequence to execute when this option is selected"), t.GetFungusScript(), t.sequence); - AddOptionCommand.Condition newCondition = (AddOptionCommand.Condition)EditorGUILayout.EnumPopup(new GUIContent("Condition", "Conditions for when this option is displayed"), t.condition); + AddOption.Condition newCondition = (AddOption.Condition)EditorGUILayout.EnumPopup(new GUIContent("Condition", "Conditions for when this option is displayed"), t.condition); if (EditorGUI.EndChangeCheck()) { @@ -31,8 +31,8 @@ namespace Fungus.Script t.condition = newCondition; } - if (t.condition == AddOptionCommand.Condition.ShowOnBoolean || - t.condition == AddOptionCommand.Condition.HideOnBoolean) + if (t.condition == AddOption.Condition.ShowOnBoolean || + t.condition == AddOption.Condition.HideOnBoolean) { string newBooleanVariableKey = EditorGUILayout.TextField(new GUIContent("Boolean Variable Key", "Boolean variable to check for condition"), t.booleanVariableKey); if (newBooleanVariableKey != t.booleanVariableKey) diff --git a/Assets/Fungus/Editor/CompareCommandEditor.cs b/Assets/Fungus/Editor/CompareCommandEditor.cs index 5f72dc62..08e860ad 100644 --- a/Assets/Fungus/Editor/CompareCommandEditor.cs +++ b/Assets/Fungus/Editor/CompareCommandEditor.cs @@ -6,12 +6,12 @@ using System.Collections.Generic; namespace Fungus.Script { - [CustomEditor (typeof(CompareCommand))] + [CustomEditor (typeof(Compare))] public class CompareCommandEditor : FungusCommandEditor { public override void DrawCommandInspectorGUI() { - CompareCommand t = target as CompareCommand; + Compare t = target as Compare; FungusScript sc = t.GetFungusScript(); if (sc == null) diff --git a/Assets/Fungus/Editor/FungusEditorWindow.cs b/Assets/Fungus/Editor/FungusEditorWindow.cs index 11792588..f2a01b08 100755 --- a/Assets/Fungus/Editor/FungusEditorWindow.cs +++ b/Assets/Fungus/Editor/FungusEditorWindow.cs @@ -90,11 +90,17 @@ namespace Fungus.Script // http://docs.unity3d.com/Documentation/ScriptReference/EditorWindow.BeginWindows.html BeginWindows(); + GUIStyle windowStyle = new GUIStyle(GUI.skin.window); + windowSequenceMap.Clear(); for (int i = 0; i < sequences.Length; ++i) { Sequence sequence = sequences[i]; - sequence.nodeRect = GUILayout.Window(i, sequence.nodeRect, DrawWindow, sequence.name, GUILayout.Width(100), GUILayout.Height(100), GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true)); + + 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(100), GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true)); windowSequenceMap.Add(sequence); } @@ -187,7 +193,6 @@ namespace Fungus.Script foreach (FungusCommand command in commands) { string commandName = command.GetType().Name; - commandName = commandName.Replace("Command", ""); if (command.errorMessage.Length > 0) { diff --git a/Assets/Fungus/Editor/SayCommandEditor.cs b/Assets/Fungus/Editor/SayCommandEditor.cs index 6265c153..eab6f631 100644 --- a/Assets/Fungus/Editor/SayCommandEditor.cs +++ b/Assets/Fungus/Editor/SayCommandEditor.cs @@ -7,12 +7,12 @@ using System.Collections.Generic; namespace Fungus.Script { - [CustomEditor (typeof(SayCommand))] + [CustomEditor (typeof(Say))] public class SayCommandEditor : FungusCommandEditor { public override void DrawCommandInspectorGUI() { - SayCommand t = target as SayCommand; + Say t = target as Say; EditorGUILayout.PrefixLabel(new GUIContent("Say Text", "Text to display in dialog")); EditorStyles.textField.wordWrap = true; diff --git a/Assets/Fungus/Editor/SetVariableCommandEditor.cs b/Assets/Fungus/Editor/SetVariableCommandEditor.cs index 53c959d5..9e17007f 100644 --- a/Assets/Fungus/Editor/SetVariableCommandEditor.cs +++ b/Assets/Fungus/Editor/SetVariableCommandEditor.cs @@ -6,12 +6,12 @@ using System.Collections.Generic; namespace Fungus.Script { - [CustomEditor (typeof(SetVariableCommand))] + [CustomEditor (typeof(SetVariable))] public class SetVariableCommandEditor : FungusCommandEditor { public override void DrawCommandInspectorGUI() { - SetVariableCommand t = target as SetVariableCommand; + SetVariable t = target as SetVariable; FungusScript fungusScript = t.GetFungusScript(); if (fungusScript == null) diff --git a/Assets/Fungus/VisualScripting/AddOptionCommand.cs b/Assets/Fungus/VisualScripting/AddOption.cs similarity index 94% rename from Assets/Fungus/VisualScripting/AddOptionCommand.cs rename to Assets/Fungus/VisualScripting/AddOption.cs index a526a9aa..78489fd1 100644 --- a/Assets/Fungus/VisualScripting/AddOptionCommand.cs +++ b/Assets/Fungus/VisualScripting/AddOption.cs @@ -5,7 +5,7 @@ using System.Collections.Generic; namespace Fungus.Script { - public class AddOptionCommand : FungusCommand + public class AddOption : FungusCommand { public enum Condition { diff --git a/Assets/Fungus/VisualScripting/AddOptionCommand.cs.meta b/Assets/Fungus/VisualScripting/AddOption.cs.meta similarity index 100% rename from Assets/Fungus/VisualScripting/AddOptionCommand.cs.meta rename to Assets/Fungus/VisualScripting/AddOption.cs.meta diff --git a/Assets/Fungus/VisualScripting/CompareCommand.cs b/Assets/Fungus/VisualScripting/Compare.cs similarity index 98% rename from Assets/Fungus/VisualScripting/CompareCommand.cs rename to Assets/Fungus/VisualScripting/Compare.cs index 7909182e..d321aafe 100644 --- a/Assets/Fungus/VisualScripting/CompareCommand.cs +++ b/Assets/Fungus/VisualScripting/Compare.cs @@ -15,7 +15,7 @@ namespace Fungus.Script GreaterThanOrEquals // >= } - public class CompareCommand : FungusCommand + public class Compare : FungusCommand { public string variableKey; diff --git a/Assets/Fungus/VisualScripting/CompareCommand.cs.meta b/Assets/Fungus/VisualScripting/Compare.cs.meta similarity index 100% rename from Assets/Fungus/VisualScripting/CompareCommand.cs.meta rename to Assets/Fungus/VisualScripting/Compare.cs.meta diff --git a/Assets/Fungus/VisualScripting/ExecuteCommand.cs b/Assets/Fungus/VisualScripting/Execute.cs similarity index 93% rename from Assets/Fungus/VisualScripting/ExecuteCommand.cs rename to Assets/Fungus/VisualScripting/Execute.cs index 937024a8..1734ab95 100644 --- a/Assets/Fungus/VisualScripting/ExecuteCommand.cs +++ b/Assets/Fungus/VisualScripting/Execute.cs @@ -6,7 +6,7 @@ using System.Collections.Generic; namespace Fungus.Script { - public class ExecuteCommand : FungusCommand + public class Execute : FungusCommand { public Sequence targetSequence; diff --git a/Assets/Fungus/VisualScripting/ExecuteCommand.cs.meta b/Assets/Fungus/VisualScripting/Execute.cs.meta similarity index 100% rename from Assets/Fungus/VisualScripting/ExecuteCommand.cs.meta rename to Assets/Fungus/VisualScripting/Execute.cs.meta diff --git a/Assets/Fungus/VisualScripting/SayCommand.cs b/Assets/Fungus/VisualScripting/Say.cs similarity index 89% rename from Assets/Fungus/VisualScripting/SayCommand.cs rename to Assets/Fungus/VisualScripting/Say.cs index 3e59c0c3..88b5e21c 100644 --- a/Assets/Fungus/VisualScripting/SayCommand.cs +++ b/Assets/Fungus/VisualScripting/Say.cs @@ -5,7 +5,7 @@ using System.Collections.Generic; namespace Fungus.Script { - public class SayCommand : FungusCommand + public class Say : FungusCommand { public string text; diff --git a/Assets/Fungus/VisualScripting/SayCommand.cs.meta b/Assets/Fungus/VisualScripting/Say.cs.meta similarity index 100% rename from Assets/Fungus/VisualScripting/SayCommand.cs.meta rename to Assets/Fungus/VisualScripting/Say.cs.meta diff --git a/Assets/Fungus/VisualScripting/SetVariableCommand.cs b/Assets/Fungus/VisualScripting/SetVariable.cs similarity index 94% rename from Assets/Fungus/VisualScripting/SetVariableCommand.cs rename to Assets/Fungus/VisualScripting/SetVariable.cs index e6828d98..5554f3cd 100644 --- a/Assets/Fungus/VisualScripting/SetVariableCommand.cs +++ b/Assets/Fungus/VisualScripting/SetVariable.cs @@ -4,7 +4,7 @@ using System.Collections; namespace Fungus.Script { - public class SetVariableCommand : FungusCommand + public class SetVariable : FungusCommand { public string variableKey; diff --git a/Assets/Fungus/VisualScripting/SetVariableCommand.cs.meta b/Assets/Fungus/VisualScripting/SetVariable.cs.meta similarity index 100% rename from Assets/Fungus/VisualScripting/SetVariableCommand.cs.meta rename to Assets/Fungus/VisualScripting/SetVariable.cs.meta diff --git a/Assets/Fungus/VisualScripting/WaitCommand.cs b/Assets/Fungus/VisualScripting/Wait.cs similarity index 84% rename from Assets/Fungus/VisualScripting/WaitCommand.cs rename to Assets/Fungus/VisualScripting/Wait.cs index 2ce26d95..8bf7f71a 100644 --- a/Assets/Fungus/VisualScripting/WaitCommand.cs +++ b/Assets/Fungus/VisualScripting/Wait.cs @@ -5,7 +5,7 @@ using System.Collections; namespace Fungus.Script { - public class WaitCommand : FungusCommand + public class Wait : FungusCommand { public float duration; diff --git a/Assets/Fungus/VisualScripting/WaitCommand.cs.meta b/Assets/Fungus/VisualScripting/Wait.cs.meta similarity index 100% rename from Assets/Fungus/VisualScripting/WaitCommand.cs.meta rename to Assets/Fungus/VisualScripting/Wait.cs.meta