Files
cocos4/cocos/tween/tween-system.ts
T
jiaxin.lai 1d14c0bc93 refactor_tween (#5794) (#5943)
* 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
2019-12-23 16:22:48 +08:00

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);
});