From ae8637f267569cc4f7319dcee9df14955ea20b59 Mon Sep 17 00:00:00 2001 From: Fenrisul Date: Sat, 27 Sep 2014 15:56:02 -0700 Subject: [PATCH] [Unity Bugfix] SkeletonAnimationInspector interfering with outside behaviour control of animation. Left TODO for further improvement later --- .../spine-unity/Editor/SkeletonAnimationInspector.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/spine-unity/Assets/spine-unity/Editor/SkeletonAnimationInspector.cs b/spine-unity/Assets/spine-unity/Editor/SkeletonAnimationInspector.cs index b32b9ba44..1035e8df7 100644 --- a/spine-unity/Assets/spine-unity/Editor/SkeletonAnimationInspector.cs +++ b/spine-unity/Assets/spine-unity/Editor/SkeletonAnimationInspector.cs @@ -67,6 +67,7 @@ public class SkeletonAnimationInspector : SkeletonRendererInspector { } + //TODO: Refactor this to use GenericMenu and callbacks to avoid interfering with control by other behaviours. // Animation name. { String[] animations = new String[component.skeleton.Data.Animations.Count + 1]; @@ -85,8 +86,10 @@ public class SkeletonAnimationInspector : SkeletonRendererInspector { EditorGUILayout.EndHorizontal(); String selectedAnimationName = animationIndex == 0 ? null : animations[animationIndex]; - component.AnimationName = selectedAnimationName; - animationName.stringValue = selectedAnimationName; + if(component.AnimationName != selectedAnimationName){ + component.AnimationName = selectedAnimationName; + animationName.stringValue = selectedAnimationName; + } }