|
@@ -21,8 +21,14 @@ var spine;
|
|
throw new Error("timelines cannot be null.");
|
|
throw new Error("timelines cannot be null.");
|
|
this.name = name;
|
|
this.name = name;
|
|
this.timelines = timelines;
|
|
this.timelines = timelines;
|
|
|
|
+ this.timelineIds = [];
|
|
|
|
+ for (var i = 0; i < timelines.length; i++)
|
|
|
|
+ this.timelineIds[timelines[i].getPropertyId()] = true;
|
|
this.duration = duration;
|
|
this.duration = duration;
|
|
}
|
|
}
|
|
|
|
+ Animation.prototype.hasTimeline = function (id) {
|
|
|
|
+ return this.timelineIds[id] == true;
|
|
|
|
+ };
|
|
Animation.prototype.apply = function (skeleton, lastTime, time, loop, events, alpha, blend, direction) {
|
|
Animation.prototype.apply = function (skeleton, lastTime, time, loop, events, alpha, blend, direction) {
|
|
if (skeleton == null)
|
|
if (skeleton == null)
|
|
throw new Error("skeleton cannot be null.");
|
|
throw new Error("skeleton cannot be null.");
|
|
@@ -1885,12 +1891,12 @@ var spine;
|
|
if (!propertyIDs.add(id))
|
|
if (!propertyIDs.add(id))
|
|
timelineMode[i] = AnimationState.SUBSEQUENT;
|
|
timelineMode[i] = AnimationState.SUBSEQUENT;
|
|
else if (to == null || timeline instanceof spine.AttachmentTimeline || timeline instanceof spine.DrawOrderTimeline
|
|
else if (to == null || timeline instanceof spine.AttachmentTimeline || timeline instanceof spine.DrawOrderTimeline
|
|
- || timeline instanceof spine.EventTimeline || !this.hasTimeline(to, id)) {
|
|
|
|
|
|
+ || timeline instanceof spine.EventTimeline || !to.animation.hasTimeline(id)) {
|
|
timelineMode[i] = AnimationState.FIRST;
|
|
timelineMode[i] = AnimationState.FIRST;
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
for (var next = to.mixingTo; next != null; next = next.mixingTo) {
|
|
for (var next = to.mixingTo; next != null; next = next.mixingTo) {
|
|
- if (this.hasTimeline(next, id))
|
|
|
|
|
|
+ if (next.animation.hasTimeline(id))
|
|
continue;
|
|
continue;
|
|
if (entry.mixDuration > 0) {
|
|
if (entry.mixDuration > 0) {
|
|
timelineMode[i] = AnimationState.HOLD_MIX;
|
|
timelineMode[i] = AnimationState.HOLD_MIX;
|
|
@@ -1916,13 +1922,6 @@ var spine;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
};
|
|
- AnimationState.prototype.hasTimeline = function (entry, id) {
|
|
|
|
- var timelines = entry.animation.timelines;
|
|
|
|
- for (var i = 0, n = timelines.length; i < n; i++)
|
|
|
|
- if (timelines[i].getPropertyId() == id)
|
|
|
|
- return true;
|
|
|
|
- return false;
|
|
|
|
- };
|
|
|
|
AnimationState.prototype.getCurrent = function (trackIndex) {
|
|
AnimationState.prototype.getCurrent = function (trackIndex) {
|
|
if (trackIndex >= this.tracks.length)
|
|
if (trackIndex >= this.tracks.length)
|
|
return null;
|
|
return null;
|