diff --git a/Assets/Fungus/FungusScript/Editor/FungusScriptEditor.cs b/Assets/Fungus/FungusScript/Editor/FungusScriptEditor.cs index f3e5bfee..5618a2bb 100644 --- a/Assets/Fungus/FungusScript/Editor/FungusScriptEditor.cs +++ b/Assets/Fungus/FungusScript/Editor/FungusScriptEditor.cs @@ -115,15 +115,25 @@ namespace Fungus } else { - ReorderableListGUI.Title("Variables"); - VariableListAdaptor adaptor = new VariableListAdaptor(variablesProp, 0); - ReorderableListControl.DrawControlFromState(adaptor, null, ReorderableListFlags.DisableContextMenu | ReorderableListFlags.HideAddButton); + Rect listRect = new Rect(); + + if (t.variables.Count > 0) + { + ReorderableListGUI.Title("Variables"); + VariableListAdaptor adaptor = new VariableListAdaptor(variablesProp, 0); + ReorderableListControl.DrawControlFromState(adaptor, null, ReorderableListFlags.DisableContextMenu | ReorderableListFlags.HideAddButton); + listRect = GUILayoutUtility.GetLastRect(); + } + else + { + GUILayoutUtility.GetRect(300, 24); + listRect = GUILayoutUtility.GetLastRect(); + listRect.y += 20; + } float plusWidth = 32; float plusHeight = 24; - Rect listRect = GUILayoutUtility.GetLastRect(); - Rect buttonRect = listRect; float buttonHeight = 24; buttonRect.x = 4;