Browse Source

Fixed undo on sequence name field

master
chrisgregan 10 years ago
parent
commit
33c592f90e
  1. 18
      Assets/Fungus/Editor/FungusScript/FungusScriptEditor.cs
  2. BIN
      Assets/Shuttle/ShuttleGame.unity

18
Assets/Fungus/Editor/FungusScript/FungusScriptEditor.cs

@ -150,16 +150,22 @@ namespace Fungus.Script
{ {
EditorGUI.BeginChangeCheck(); EditorGUI.BeginChangeCheck();
string sequenceName = EditorGUILayout.TextField(new GUIContent("Sequence Name", "Name of sequence displayed in editor window"), sequence.name); string name = EditorGUILayout.TextField(new GUIContent("Sequence Name", "Name of sequence displayed in editor window"), sequence.name);
string sequenceDescription = EditorGUILayout.TextField(new GUIContent("Description", "Sequence description displayed in editor window"), sequence.description); string desc = EditorGUILayout.TextField(new GUIContent("Description", "Sequence description displayed in editor window"), sequence.description);
EditorGUILayout.Separator(); EditorGUILayout.Separator();
if (EditorGUI.EndChangeCheck()) if (name != sequence.name)
{
// The name is the gameobject name, so have to undo seperately
Undo.RecordObject(sequence.gameObject, "Set Sequence Name");
sequence.name = name;
}
if (desc != sequence.description)
{ {
Undo.RecordObject(sequence, "Set Sequence"); Undo.RecordObject(sequence, "Set Sequence Description");
sequence.name = sequenceName; sequence.description = desc;
sequence.description = sequenceDescription;
} }
EditorGUILayout.PrefixLabel("Commands"); EditorGUILayout.PrefixLabel("Commands");

BIN
Assets/Shuttle/ShuttleGame.unity

Binary file not shown.
Loading…
Cancel
Save