const { ccclass, property } = cc._decorator; enum LevelType{ Level_1, Level_2 } @ccclass export default class CNXX_selectLevel extends cc.Component { @property(cc.Node) guideNode:cc.Node = null curSelectLevel = LevelType.Level_1 start() { } onBtnClose(){ this.node.removeFromParent() this.node.destroy() } onBtnLevel_1(){ this.guideNode.active = true this.curSelectLevel = LevelType.Level_1 } onBtnLevel_2(){ this.guideNode.active = true this.curSelectLevel = LevelType.Level_2 } onBtnSureClick(){ // if(this.curSelectLevel == LevelType.Level_1){ // PrefabManage.loadPrefabByType(GameType.CNXX_firstLevel) // }else{ // PrefabManage.loadPrefabByType(GameType.CNXX_secondLevel) // } this.onBtnClose() } }