mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-12-08 14:00:02 +00:00
提交
This commit is contained in:
@@ -16,6 +16,8 @@ export enum BattleMode{
|
||||
OnHook = 0,
|
||||
//PVP 模式
|
||||
PVP = 1,
|
||||
//阵营守护
|
||||
CampGuardian = 2,
|
||||
}
|
||||
|
||||
export interface GBattleModeInfo{
|
||||
@@ -77,6 +79,7 @@ export default class GBattleModeManager extends Singleton {
|
||||
this.modes = info.modes || [];
|
||||
this.camera = info.camera;
|
||||
this.root = info.root;
|
||||
this.camera.enabled = false;
|
||||
|
||||
//监听帧同步 世界创建逻辑
|
||||
app.event.on(JNSyncFrameEvent.CLEAR,this.clear,this);
|
||||
@@ -158,6 +161,8 @@ export default class GBattleModeManager extends Singleton {
|
||||
private clear(){
|
||||
if(!this.isInit) return;
|
||||
this.root.destroyAllChildren();
|
||||
//关闭相机
|
||||
this.camera.enabled = false;
|
||||
}
|
||||
|
||||
//创建当前模式
|
||||
@@ -165,6 +170,8 @@ export default class GBattleModeManager extends Singleton {
|
||||
|
||||
if(!this.isInit || this.current == null) return;
|
||||
let mode = instantiate(this.modes[this.current]);
|
||||
//关闭相机
|
||||
this.camera.enabled = false;
|
||||
mode.getComponent(GBaseMode).camera = this.camera;
|
||||
mode.getComponent(GBaseMode).data = this.data;
|
||||
this.root.addChild(mode)
|
||||
|
||||
Reference in New Issue
Block a user