mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-06 19:42:39 +08:00
284aa38d25
* consts * Bump @cocos/build-engine version * Fix * Upload @cocos/build-engine * Rm scripts/build-engine/.gitignore
31 lines
744 B
TypeScript
31 lines
744 B
TypeScript
/**
|
|
* @category tween
|
|
*/
|
|
|
|
import { System, Director, director } from "../core";
|
|
import { ActionManager } from "./actions/action-manager";
|
|
import { EDITOR } from 'internal:constants';
|
|
|
|
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 (!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);
|
|
}); |