From 8fa441e284e9f61bb27403074fd3a49cd3f0f96e Mon Sep 17 00:00:00 2001 From: John Date: Fri, 2 Jun 2017 21:59:00 +0800 Subject: [PATCH] [csharp] Return true from AnimationState#apply if any animation was applied. --- spine-csharp/src/AnimationState.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/spine-csharp/src/AnimationState.cs b/spine-csharp/src/AnimationState.cs index 937f8eb7a..96e1df377 100644 --- a/spine-csharp/src/AnimationState.cs +++ b/spine-csharp/src/AnimationState.cs @@ -159,16 +159,18 @@ namespace Spine { /// /// Poses the skeleton using the track entry animations. There are no side effects other than invoking listeners, so the /// animation state can be applied to multiple skeletons to pose them identically. - public void Apply (Skeleton skeleton) { + public bool Apply (Skeleton skeleton) { if (skeleton == null) throw new ArgumentNullException("skeleton", "skeleton cannot be null."); if (animationsChanged) AnimationsChanged(); var events = this.events; + bool applied = false; var tracksItems = tracks.Items; for (int i = 0, m = tracks.Count; i < m; i++) { TrackEntry current = tracksItems[i]; if (current == null || current.delay > 0) continue; + applied = true; // Apply mixing from entries first. float mix = current.alpha; @@ -210,6 +212,7 @@ namespace Spine { } queue.Drain(); + return applied; } private float ApplyMixingFrom (TrackEntry to, Skeleton skeleton) {