var stateManagerMachine = {
init: () => {
setInterval(() => {
this.animation();
}, 16);
},
bool: false,
register: (delay, fn) => {
if (this.delay === undefined) delay = 1;
this.states.push({
delay,
fn
});
},
checkLock() {
if (!this.states.length) this.bool = false;
},
states: [],
animation() {
if (!this.bool) return;
checkLock();
}
};
stateManagerMachine.register();
statemachine
最新推荐文章于 2024-06-16 15:59:05 发布