diff --git a/Assets/Fungus/Scripts/Components/Flowchart.cs b/Assets/Fungus/Scripts/Components/Flowchart.cs index 10cdfa0b..e1cf6cad 100644 --- a/Assets/Fungus/Scripts/Components/Flowchart.cs +++ b/Assets/Fungus/Scripts/Components/Flowchart.cs @@ -81,7 +81,7 @@ namespace Fungus [SerializeField] protected string luaBindingName = "flowchart"; [Tooltip("Draw the variable gui in the inspector.")] - [SerializeField] protected bool showVariablesInInspector = true; + [SerializeField] protected bool showVariables = true; protected static List cachedFlowcharts = new List(); diff --git a/Assets/Fungus/Scripts/Editor/FlowchartEditor.cs b/Assets/Fungus/Scripts/Editor/FlowchartEditor.cs index c769b8a8..9b21447e 100644 --- a/Assets/Fungus/Scripts/Editor/FlowchartEditor.cs +++ b/Assets/Fungus/Scripts/Editor/FlowchartEditor.cs @@ -50,7 +50,7 @@ namespace Fungus.EditorUtils hideCommandsProp = serializedObject.FindProperty("hideCommands"); luaEnvironmentProp = serializedObject.FindProperty("luaEnvironment"); luaBindingNameProp = serializedObject.FindProperty("luaBindingName"); - varInspectorProp = serializedObject.FindProperty("showVariablesInInspector"); + varInspectorProp = serializedObject.FindProperty("showVariables"); addTexture = FungusEditorResources.AddSmall; } @@ -72,11 +72,7 @@ namespace Fungus.EditorUtils EditorGUILayout.PropertyField(showLineNumbersProp); EditorGUILayout.PropertyField(luaEnvironmentProp); EditorGUILayout.PropertyField(luaBindingNameProp); - - if (!FungusEditorPreferences.hideVariableInFlowchartInspector) - { - EditorGUILayout.PropertyField(varInspectorProp); - } + EditorGUILayout.PropertyField(varInspectorProp); // Show list of commands to hide in Add Command menu ReorderableListGUI.Title(new GUIContent(hideCommandsProp.displayName, hideCommandsProp.tooltip)); @@ -95,7 +91,7 @@ namespace Fungus.EditorUtils serializedObject.ApplyModifiedProperties(); - if (varInspectorProp.boolValue && !FungusEditorPreferences.hideVariableInFlowchartInspector) + if (varInspectorProp.boolValue) { GUILayout.Space(20); diff --git a/Assets/Fungus/Scripts/Editor/FungusEditorPreferences.cs b/Assets/Fungus/Scripts/Editor/FungusEditorPreferences.cs index 4f8fe4ca..14312634 100644 --- a/Assets/Fungus/Scripts/Editor/FungusEditorPreferences.cs +++ b/Assets/Fungus/Scripts/Editor/FungusEditorPreferences.cs @@ -17,8 +17,7 @@ namespace Fungus // Have we loaded the prefs yet private static bool prefsLoaded = false; - public static bool hideMushroomInHierarchy, - hideVariableInFlowchartInspector ; + public static bool hideMushroomInHierarchy; static FungusEditorPreferences() { @@ -37,20 +36,17 @@ namespace Fungus // Preferences GUI hideMushroomInHierarchy = EditorGUILayout.Toggle("Hide Mushroom Flowchart Icon", hideMushroomInHierarchy); - hideVariableInFlowchartInspector = EditorGUILayout.Toggle("Hide Variables in Flowchart Inspector", hideVariableInFlowchartInspector); // Save the preferences if (GUI.changed) { EditorPrefs.SetBool("hideMushroomInHierarchy", hideMushroomInHierarchy); - EditorPrefs.SetBool("hideVariableInFlowchartInspector", hideVariableInFlowchartInspector); } } public static void LoadOnScriptLoad() { hideMushroomInHierarchy = EditorPrefs.GetBool("hideMushroomInHierarchy", false); - hideVariableInFlowchartInspector = EditorPrefs.GetBool("hideVariableInFlowchartInspector", true); prefsLoaded = true; } }