Browse Source

Undo command expand

master
chrisgregan 11 years ago
parent
commit
a467654c13
  1. 8
      Assets/Fungus/Editor/FungusScript/FungusCommandEditor.cs

8
Assets/Fungus/Editor/FungusScript/FungusCommandEditor.cs

@ -29,7 +29,13 @@ namespace Fungus.Script
GUILayout.BeginHorizontal(); GUILayout.BeginHorizontal();
t.expanded = EditorGUILayout.Foldout(t.expanded, t.GetType().Name); bool expanded = EditorGUILayout.Foldout(t.expanded, t.GetType().Name);
if (expanded != t.expanded)
{
Undo.RecordObject(t, "Set Expanded");
t.expanded = expanded;
}
GUIStyle labelStyle = EditorStyles.miniLabel; GUIStyle labelStyle = EditorStyles.miniLabel;
GUILayout.Label(t.GetDescription().Replace("\n", "").Replace("\r", ""), labelStyle); GUILayout.Label(t.GetDescription().Replace("\n", "").Replace("\r", ""), labelStyle);

Loading…
Cancel
Save