init
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import { _decorator, Camera, Component, Node } from "cc";
|
||||
import GameRootUI from "../Main/Common/GameRootUI";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
//主界面场景
|
||||
@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, "UI/StartUI/Start_UI");
|
||||
}
|
||||
GameRootUI.MainCamera = this.MainCamera
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user