Forráskód Böngészése

[as3] AnimationState#apply returns boolean indicating if any timeline was applied. #919

badlogic 8 éve
szülő
commit
0eaf8fcfa0

BIN
spine-as3/spine-as3-example/lib/spine-as3.swc


+ 4 - 1
spine-as3/spine-as3/src/spine/animation/AnimationState.as

@@ -147,15 +147,17 @@ package spine.animation {
 			return false;
 		}
 
-		public function apply(skeleton : Skeleton) : void {
+		public function apply(skeleton : Skeleton) : Boolean {
 			if (skeleton == null) throw new ArgumentError("skeleton cannot be null.");
 			if (animationsChanged) _animationsChanged();
 
 			var events : Vector.<Event> = this.events;
+			var applied : Boolean = false;
 
 			for (var i : int = 0, n : int = tracks.length; i < n; i++) {
 				var current : TrackEntry = tracks[i];
 				if (current == null || current.delay > 0) continue;
+				applied = true;
 
 				// Apply mixing from entries first.
 				var mix : Number = current.alpha;
@@ -194,6 +196,7 @@ package spine.animation {
 			}
 
 			queue.drain();
+			return applied;
 		}
 
 		private function applyMixingFrom(to : TrackEntry, skeleton : Skeleton) : Number {

BIN
spine-starling/spine-starling-example/lib/spine-as3.swc


BIN
spine-starling/spine-starling/lib/spine-as3.swc