1234567891011121314151617181920212223242526272829303132333435363738 |
- export class GameLogicMgr {
- private static _inst: GameLogicMgr;
- public static get inst(): GameLogicMgr {
- if (this._inst == null) {
- this._inst = new GameLogicMgr();
- this._inst.init();
- }
- return this._inst;
- }
- isGamePause: boolean = false;
- switch(){
- this.isGamePause = !this.isGamePause;
- //@ts-ignore
- dragonBones.timeScale = this.isGamePause ? 0 : 1;
- }
- init(){
- //@ts-ignore
- let aniMgr = cc.director.getAnimationManager();
-
- if(!CC_EDITOR){
- aniMgr._oldUpdate = aniMgr.update;
- aniMgr.update = function(dt){
- if(GameLogicMgr.inst.isGamePause) return;
- aniMgr._oldUpdate(dt);
- }
- }
- }
- };
|