Parcourir la source

[unity] Fixed ignored SkeletonAnimation looping change when AnimationName is the same. Closes #1396.

Harald Csaszar il y a 6 ans
Parent
commit
b1c1dac17a

+ 5 - 2
spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonAnimation.cs

@@ -96,8 +96,11 @@ namespace Spine.Unity {
 				}
 			}
 			set {
-				if (_animationName == value)
-					return;
+				if (_animationName == value) {
+					TrackEntry entry = state.GetCurrent(0);
+					if (entry != null && entry.loop == loop)
+						return;
+				}
 				_animationName = value;
 
 				if (string.IsNullOrEmpty(value)) {