From 0a835647bfaf45d71ab5b0dbda2d2cc6a91309a2 Mon Sep 17 00:00:00 2001 From: desktop-maesty/steve Date: Sat, 7 Sep 2019 18:53:16 +1000 Subject: [PATCH] Character only sets self dirty if change detected, fixes it stealing focus from ContextMenus --- Assets/Fungus/Scripts/Editor/CharacterEditor.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Assets/Fungus/Scripts/Editor/CharacterEditor.cs b/Assets/Fungus/Scripts/Editor/CharacterEditor.cs index 60c4bbaf..057692be 100644 --- a/Assets/Fungus/Scripts/Editor/CharacterEditor.cs +++ b/Assets/Fungus/Scripts/Editor/CharacterEditor.cs @@ -33,6 +33,7 @@ namespace Fungus.EditorUtils serializedObject.Update(); Character t = target as Character; + EditorGUI.BeginChangeCheck(); EditorGUILayout.PropertyField(nameTextProp, new GUIContent("Name Text", "Name of the character display in the dialog")); EditorGUILayout.PropertyField(nameColorProp, new GUIContent("Name Color", "Color of name text display in the dialog")); @@ -75,7 +76,8 @@ namespace Fungus.EditorUtils EditorGUILayout.Separator(); - EditorUtility.SetDirty(t); + if(EditorGUI.EndChangeCheck()) + EditorUtility.SetDirty(t); serializedObject.ApplyModifiedProperties(); }