This commit is contained in:
2025-09-11 13:29:08 +08:00
parent f3cfcecadf
commit ae80fb250a
14 changed files with 1254 additions and 2414 deletions
+17 -16
View File
@@ -4,22 +4,23 @@ import GameRootUI from "../Main/Common/GameRootUI";
const { ccclass, property } = _decorator;
//主界面场景
@ccclass("MainScene")
@ccclass('MainScene')
export class MainScene extends Component {
@property(Node)
UIRoot: Node = null;
@property(Node)
UILayerMod: Node = null;
@property(Camera)
MainCamera: Camera = null;
start() {
//每个场景必须添加的
let gameRootUI = this.node.getComponent(GameRootUI);
if (!gameRootUI) {
gameRootUI = this.node.addComponent(GameRootUI);
gameRootUI.InitByCreate(this.UIRoot, this.UILayerMod, "MainPanel");
@property(Node)
UIRoot: Node = null
@property(Node)
UILayerMod: Node = null
@property(Camera)
MainCamera: Camera = null
start() {
//每个场景必须添加的
let gameRootUI = this.node.getComponent(GameRootUI)
if (!gameRootUI){
gameRootUI = this.node.addComponent(GameRootUI)
gameRootUI.InitByCreate(this.UIRoot, this.UILayerMod, "ThemePanel");
}
GameRootUI.MainCamera = this.MainCamera
}
GameRootUI.MainCamera = this.MainCamera;
}
}
}