Browse Source

Fixed variables window when variable count == 0

master
chrisgregan 10 years ago
parent
commit
77985ca4de
  1. 20
      Assets/Fungus/FungusScript/Editor/FungusScriptEditor.cs

20
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;

Loading…
Cancel
Save