diff --git a/Assets/Fungus/Editor/FungusScript/FungusScriptEditor.cs b/Assets/Fungus/Editor/FungusScript/FungusScriptEditor.cs index bd05f7e8..690698f9 100644 --- a/Assets/Fungus/Editor/FungusScript/FungusScriptEditor.cs +++ b/Assets/Fungus/Editor/FungusScript/FungusScriptEditor.cs @@ -19,16 +19,13 @@ namespace Fungus.Script { variablesProperty = serializedObject.FindProperty("variables"); } - - FungusScript t = target as FungusScript; - if (t != null) - { - t.transform.hideFlags = HideFlags.HideInInspector; - } } public void OnInspectorUpdate() { + + FungusScript t = target as FungusScript; + Repaint(); } @@ -38,6 +35,13 @@ namespace Fungus.Script FungusScript t = target as FungusScript; + if (t != null) + { + // Hide the transform component if FungusScript is the only component on the game object + Component[] components = t.GetComponents(typeof(Component)); + t.transform.hideFlags = (components.Length == 2) ? HideFlags.HideInInspector : HideFlags.None; + } + float stepTime = EditorGUILayout.FloatField(new GUIContent("Step Time", "Minimum time to execute each step"), t.stepTime); EditorGUI.BeginChangeCheck();