123456789101112131415161718192021222324252627282930313233343536373839 |
- import { _decorator, Component, Node, Prefab } from 'cc';
- import { EventDispatcher } from '../../engines/events/EventDispatcher';
- const { ccclass, property } = _decorator;
- export class GameModel extends EventDispatcher{
-
- public static KILL_COUNT_CHANGED:string="KILL_COUNT_CHANGED";
- currentWeaponId:number=2;
- currentLevel:number=1;
- currentFenceId:number=1;
-
- /**
- * 击杀数量
- */
- private _killCount:number=0;
- constructor(){
- super();
- }
- get killCount():number{
- return this._killCount;
- }
- set killCount(value:number){
- this._killCount=value;
- this.DispatchEvent(GameModel.KILL_COUNT_CHANGED);
- }
-
- private static instance:GameModel;
- public static get single():GameModel{
- if(this.instance==null){
- this.instance=new GameModel();
- }
- return this.instance;
- }
- }
|