mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-06-26 19:34:47 +00:00
40 lines
863 B
TypeScript
40 lines
863 B
TypeScript
import { _decorator, Component, Node, Prefab } from 'cc';
|
|
import { Camera } from 'cc';
|
|
import GBattleModeManager from './battle/GBattleModeManager';
|
|
const { ccclass, property } = _decorator;
|
|
|
|
@ccclass('WorldCanvas')
|
|
export class WorldCanvas extends Component {
|
|
|
|
@property(Node)
|
|
root:Node = null;
|
|
@property(Camera)
|
|
camera:Camera = null;
|
|
|
|
@property([Prefab])
|
|
modes:Prefab[] = [];
|
|
|
|
index:number = 1;
|
|
|
|
async onLoad(){
|
|
|
|
//重置相机位置
|
|
this.camera.node.setWorldPosition(0,0,1000);
|
|
|
|
//初始化游戏模式管理器
|
|
GBattleModeManager.getIns().onInit({
|
|
modes:this.modes, //模式
|
|
camera:this.camera, //相机
|
|
root:this.root, //场景
|
|
});
|
|
|
|
}
|
|
|
|
update(deltaTime: number) {
|
|
GBattleModeManager.getIns().onUpdate(deltaTime);
|
|
}
|
|
|
|
}
|
|
|
|
|