mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-02 00:22:43 +08:00
1d14c0bc93
* refactor_tween (#5794) * copy from master branch cocos2d actions * tweaks & stash * tweaks * stash * stash * tweaks * fix repeatForever init * fix repeat、repeatForever、reverseTime * add elastic out in to easing * add typing * add adapter & checker; add api doc; * tweaks * fix tween number * tweaks * tweaks * remove tween.js * rename actions to tween * export Tween * allow mutiple remove action * using new api * remove deprecated from tween * add deprecated to tweenUtil * fix ci test
30 lines
702 B
TypeScript
30 lines
702 B
TypeScript
/**
|
|
* @category tween
|
|
*/
|
|
|
|
import { System, Director, director } from "../core";
|
|
import { ActionManager } from "./actions/action-manager";
|
|
|
|
export class TweenSystem extends System {
|
|
static readonly ID = 'tween';
|
|
|
|
static readonly instance: TweenSystem;
|
|
|
|
get ActionManager () {
|
|
return this.actionMgr;
|
|
}
|
|
|
|
private readonly actionMgr = new ActionManager();
|
|
|
|
postUpdate (dt: number) {
|
|
if (!CC_EDITOR || this._executeInEditMode) {
|
|
this.actionMgr.update(dt);
|
|
}
|
|
}
|
|
}
|
|
|
|
director.on(Director.EVENT_INIT, function () {
|
|
let sys = new TweenSystem();
|
|
(TweenSystem.instance as any) = sys;
|
|
director.registerSystem(TweenSystem.ID, sys, 100);
|
|
}); |