@ives_xxz/framework 2.1.2 → 2.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,6 @@ import { FWManager } from './FWManager';
2
2
 
3
3
  export default class FWEngineManager extends FWManager implements FW.EngineManager {
4
4
  debug: boolean = false;
5
- launchScene: string = '';
6
5
 
7
6
  initialize() {
8
7
  this.registerCCCSystemEvent();
@@ -11,14 +10,17 @@ export default class FWEngineManager extends FWManager implements FW.EngineManag
11
10
  onDestroy(): void {
12
11
  cc.game.off(cc.game.EVENT_SHOW, this.onAppShow, this);
13
12
  cc.game.off(cc.game.EVENT_HIDE, this.onAppHide, this);
14
- cc.game.off(cc.game.EVENT_GAME_INITED, this.onEngineInited, this);
15
13
  }
16
14
 
17
15
  restart() {
16
+ if (!launchScene) {
17
+ FW.Log.error('请设置启动场景');
18
+ return;
19
+ }
18
20
  FW.Entry.evtMgr.dispatch(FW.EventDefine.SystemEvent.SYSTEM_RESTART);
19
21
  FW.Entry.initialize();
20
22
  FW.Framework.restart();
21
- FW.Entry.launchScene(this.launchScene);
23
+ FW.Entry.launchScene(launchScene);
22
24
  }
23
25
 
24
26
  getMemory() {
@@ -46,14 +48,6 @@ export default class FWEngineManager extends FWManager implements FW.EngineManag
46
48
  private registerCCCSystemEvent() {
47
49
  cc.game.on(cc.game.EVENT_SHOW, this.onAppShow, this);
48
50
  cc.game.on(cc.game.EVENT_HIDE, this.onAppHide, this);
49
- cc.game.on(cc.game.EVENT_ENGINE_INITED, this.onEngineInited, this);
50
- }
51
-
52
- private onEngineInited() {
53
- FW.Entry.timeMgr.scheduleOnce(() => {
54
- this.launchScene = cc.director.getScene()?.name || 'launchScene';
55
- FW.Log.debug('初始启动场景:', this.launchScene);
56
- });
57
51
  }
58
52
 
59
53
  /** 应用切换到前台 */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ives_xxz/framework",
3
- "version": "2.1.2",
3
+ "version": "2.1.3",
4
4
  "description": "cocoscreator 2.x mvc framework",
5
5
  "main": "index.js",
6
6
  "keywords": ["123456"],
package/types/FW.d.ts CHANGED
@@ -1299,7 +1299,6 @@ declare namespace FW {
1299
1299
  debug: boolean;
1300
1300
  getMemory(): void;
1301
1301
  restart(): void;
1302
- launchScene: string;
1303
1302
  };
1304
1303
 
1305
1304
  type CCEvent = {
package/types/Global.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  declare namespace globalThis {
2
+ export var launchScene: string;
2
3
  export function PerformanceMonitor(operationName?: string);
3
4
  export function FWDeprecated(description?: string);
4
5
  export function FWSocketAutoProcessPause();