add option to reset animation state when removing animation from queue
This commit is contained in:
@@ -40,9 +40,13 @@ class MotionEngine {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
this.clear = function (object) {
|
this.clear = function (object, reset = false) {
|
||||||
for (var i = aq.length - 1; i >= 0; i--) {
|
for (var i = aq.length - 1; i >= 0; i--) {
|
||||||
if (object && aq[i].o == object || !object && (aq[i].ct == aq[i].t || aq[i].rr)) {
|
if (object && aq[i].o == object || !object && (aq[i].ct == aq[i].t || aq[i].rr)) {
|
||||||
|
if (reset){
|
||||||
|
aq[i].ct = 0;
|
||||||
|
this.animate(aq[i], 0);
|
||||||
|
}
|
||||||
aq.splice(i, 1);
|
aq.splice(i, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user