GameModel.ts 806 B

123456789101112131415161718192021222324252627282930313233343536
  1. // Learn TypeScript:
  2. // - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
  3. // Learn Attribute:
  4. // - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
  5. // Learn life-cycle callbacks:
  6. // - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
  7. const {ccclass, property} = cc._decorator;
  8. @ccclass
  9. export default class GameModel extends cc.Component {
  10. @property({
  11. type:cc.Integer,
  12. tooltip:"调试关卡"
  13. })
  14. debugLevel:number=0;
  15. @property({
  16. type:cc.Integer,
  17. tooltip:"当前关卡"
  18. })
  19. currentlevel:number=0;
  20. onLoad(){
  21. GameModel.instance=this;
  22. }
  23. private static instance:GameModel;
  24. public static get single()
  25. {
  26. return this.instance;
  27. }
  28. }