mirror of
https://github.com/MapMakersAndProgrammers/Alternativa3D.git
synced 2025-10-27 02:19:11 -07:00
ScriptTimeoutError:: fixed in AnimationController
This commit is contained in:
@@ -237,13 +237,14 @@ package alternativa.engine3d.animation {
|
|||||||
_time += interval*speed;
|
_time += interval*speed;
|
||||||
if (loop) {
|
if (loop) {
|
||||||
if (_time < 0) {
|
if (_time < 0) {
|
||||||
|
// TODO: Loop processing
|
||||||
// _position = (length <= 0) ? 0 : _position % length;
|
// _position = (length <= 0) ? 0 : _position % length;
|
||||||
_time = 0;
|
_time = 0;
|
||||||
} else {
|
} else {
|
||||||
if (_time >= length) {
|
if (_time >= length) {
|
||||||
collectNotifiers(oldTime, length);
|
collectNotifiers(oldTime, length);
|
||||||
_time = (length <= 0) ? 0 : _time % length;
|
_time = (length <= 0) ? 0 : _time % length;
|
||||||
collectNotifiers(0, _time);
|
collectNotifiers(0, _time < oldTime ? _time : oldTime);
|
||||||
} else {
|
} else {
|
||||||
collectNotifiers(oldTime, _time);
|
collectNotifiers(oldTime, _time);
|
||||||
}
|
}
|
||||||
@@ -351,17 +352,12 @@ package alternativa.engine3d.animation {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
alternativa3d function collectNotifiers(start:Number, end:Number):void {
|
alternativa3d function collectNotifiers(start:Number, end:Number):void {
|
||||||
var notify:AnimationNotify = _notifiersList;
|
for (var notify:AnimationNotify = _notifiersList; notify != null; notify = notify.next) {
|
||||||
while (notify != null) {
|
if (notify._time > start && notify._time <= end) {
|
||||||
if (notify._time > start) {
|
// add notify to dispatched
|
||||||
if (notify._time > end) {
|
|
||||||
notify = notify.next;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
notify.processNext = controller.nearestNotifyers;
|
notify.processNext = controller.nearestNotifyers;
|
||||||
controller.nearestNotifyers = notify;
|
controller.nearestNotifyers = notify;
|
||||||
}
|
}
|
||||||
notify = notify.next;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -132,10 +132,13 @@ package alternativa.engine3d.animation {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Calls the notifications
|
// Calls the notifications
|
||||||
for (var notify:AnimationNotify = nearestNotifyers; notify != null; notify = notify.processNext) {
|
for (var notify:AnimationNotify = nearestNotifyers; notify != null;) {
|
||||||
if (notify.willTrigger(NotifyEvent.NOTIFY)) {
|
if (notify.willTrigger(NotifyEvent.NOTIFY)) {
|
||||||
notify.dispatchEvent(new NotifyEvent(notify));
|
notify.dispatchEvent(new NotifyEvent(notify));
|
||||||
}
|
}
|
||||||
|
var nt:AnimationNotify = notify;
|
||||||
|
notify = notify.processNext;
|
||||||
|
nt.processNext = null;
|
||||||
}
|
}
|
||||||
nearestNotifyers = null;
|
nearestNotifyers = null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user