// Learn TypeScript: // - https://docs.cocos.com/creator/manual/en/scripting/typescript.html // Learn Attribute: // - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html // Learn life-cycle callbacks: // - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html const {ccclass, property} = cc._decorator; @ccclass export default class GameModel extends cc.Component { @property({ type:cc.Integer, tooltip:"调试关卡" }) debugLevel:number=0; @property({ type:cc.Integer, tooltip:"当前关卡" }) currentlevel:number=0; onLoad(){ GameModel.instance=this; } private static instance:GameModel; public static get single() { return this.instance; } }