From 33c592f90ec89761154d9667cbf5cc1375a3a53d Mon Sep 17 00:00:00 2001 From: chrisgregan Date: Mon, 18 Aug 2014 12:48:33 +0100 Subject: [PATCH] Fixed undo on sequence name field --- .../Editor/FungusScript/FungusScriptEditor.cs | 18 ++++++++++++------ Assets/Shuttle/ShuttleGame.unity | Bin 81980 -> 82644 bytes 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Assets/Fungus/Editor/FungusScript/FungusScriptEditor.cs b/Assets/Fungus/Editor/FungusScript/FungusScriptEditor.cs index f9757bcd..70ad5704 100644 --- a/Assets/Fungus/Editor/FungusScript/FungusScriptEditor.cs +++ b/Assets/Fungus/Editor/FungusScript/FungusScriptEditor.cs @@ -150,16 +150,22 @@ namespace Fungus.Script { EditorGUI.BeginChangeCheck(); - string sequenceName = 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 name = EditorGUILayout.TextField(new GUIContent("Sequence Name", "Name of sequence displayed in editor window"), sequence.name); + string desc = EditorGUILayout.TextField(new GUIContent("Description", "Sequence description displayed in editor window"), sequence.description); 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"); - sequence.name = sequenceName; - sequence.description = sequenceDescription; + Undo.RecordObject(sequence, "Set Sequence Description"); + sequence.description = desc; } EditorGUILayout.PrefixLabel("Commands"); diff --git a/Assets/Shuttle/ShuttleGame.unity b/Assets/Shuttle/ShuttleGame.unity index 60506a40fbd5136384168bc167b9bbe44742b282..00b6650f9b66e20cc8f3a674278a92b1a1320d96 100644 GIT binary patch delta 1584 zcmZA1Ur19?90%~^F*`?*U9PfhhIc+=INJ5Dh=pZxsAvV z`>ES+S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