Spaces:
Build error
Build error
File size: 1,364 Bytes
670a607 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
import EaseValueTask from '../../../plugins/utils/ease/EaseValueTask.js';
var Start = function (duration) {
if (!this.easeValueTask) {
this.easeValueTask = new EaseValueTask(this, { eventEmitter: null });
}
if (duration !== undefined) {
this.duration = duration;
this.easeValueTask.stop(); // Will restart with new duration
}
// Won't restart if easeValueTask is running
if (this.easeValueTask.isRunning) {
return this;
}
// Start easeValueTask
this.easeValueTask.restart({
key: 'value',
from: 0, to: 1,
duration: this.duration,
ease: this.ease,
repeat: -1, // -1: infinity
delay: this.delay,
repeatDelay: this.repeatDelay
});
this.setDirty();
return this;
}
var Stop = function () {
if (!this.easeValueTask) {
return this;
}
this.easeValueTask.stop();
this.setDirty();
return this;
}
var Pause = function () {
if (!this.easeValueTask) {
return this;
}
this.easeValueTask.pause();
this.setDirty();
return this;
}
var Resume = function () {
if (!this.easeValueTask) {
return this;
}
this.easeValueTask.pause();
this.setDirty();
return this;
}
export default {
start: Start,
stop: Stop,
pause: Pause,
resume: Resume
} |