mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-06 18:56:54 +08:00
[as3] AnimationState#apply returns boolean indicating if any timeline was applied. #919
This commit is contained in:
parent
b5e08f59e1
commit
0eaf8fcfa0
Binary file not shown.
@ -147,15 +147,17 @@ package spine.animation {
|
|||||||
return false;
|
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 (skeleton == null) throw new ArgumentError("skeleton cannot be null.");
|
||||||
if (animationsChanged) _animationsChanged();
|
if (animationsChanged) _animationsChanged();
|
||||||
|
|
||||||
var events : Vector.<Event> = this.events;
|
var events : Vector.<Event> = this.events;
|
||||||
|
var applied : Boolean = false;
|
||||||
|
|
||||||
for (var i : int = 0, n : int = tracks.length; i < n; i++) {
|
for (var i : int = 0, n : int = tracks.length; i < n; i++) {
|
||||||
var current : TrackEntry = tracks[i];
|
var current : TrackEntry = tracks[i];
|
||||||
if (current == null || current.delay > 0) continue;
|
if (current == null || current.delay > 0) continue;
|
||||||
|
applied = true;
|
||||||
|
|
||||||
// Apply mixing from entries first.
|
// Apply mixing from entries first.
|
||||||
var mix : Number = current.alpha;
|
var mix : Number = current.alpha;
|
||||||
@ -194,6 +196,7 @@ package spine.animation {
|
|||||||
}
|
}
|
||||||
|
|
||||||
queue.drain();
|
queue.drain();
|
||||||
|
return applied;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function applyMixingFrom(to : TrackEntry, skeleton : Skeleton) : Number {
|
private function applyMixingFrom(to : TrackEntry, skeleton : Skeleton) : Number {
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user