@ives_xxz/framework 2.1.1 → 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.
- package/manager/FWEngineManager.ts +5 -10
- package/package.json +1 -1
- package/types/FW.d.ts +0 -1
- package/types/Global.d.ts +1 -0
|
@@ -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.onCreatorInited, 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(
|
|
23
|
+
FW.Entry.launchScene(launchScene);
|
|
22
24
|
}
|
|
23
25
|
|
|
24
26
|
getMemory() {
|
|
@@ -46,13 +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_GAME_INITED, this.onCreatorInited, this);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
private onCreatorInited() {
|
|
53
|
-
FW.Entry.timeMgr.scheduleOnce(() => {
|
|
54
|
-
this.launchScene = cc.director.getScene()?.name || 'launchScene';
|
|
55
|
-
});
|
|
56
51
|
}
|
|
57
52
|
|
|
58
53
|
/** 应用切换到前台 */
|
package/package.json
CHANGED
package/types/FW.d.ts
CHANGED