games/ChaoJiJieYaGuan_MaJiang2/assets/Script/Tools/PlayData.ts

50 lines
870 B
TypeScript

/**
* 游戏中涉及到一些全局数据
* 单例
*/
import Define, { GameType } from "./Define"
export enum GameState{
none,start,wait,gaming,end
}
export default class PlayData {
public static _instance:PlayData = null
enterStartSceneIndex = 0
energytime = 0
openId = null
gameType:GameType = GameType.none
guanqia = 0
enerytime = Define.eneryTime
gamestate = GameState.none
selectMapIndex = 0
cebianlingquState = 0
gamepause = !1 //游戏暂停判断
backGameIndex = 0
userInfo={
}
//游戏过程中的数据
gameDate = {
}
/**
* 存储游戏关卡数据
*/
storageGameDate = null
public static get Instance(){
if(this._instance == null){
this._instance = new PlayData()
}
return this._instance
}
}