定义如下:
class DataMgr {
constructor() {
this.instance = null;
this.getInstance = function ()
{
if(this.instance == null)
{
this.instance = new DataMgr();
}
return this.instance;
}
this.stageData = new Array(); // 所有关卡数据容器
// 函数声明
DataMgr.prototype = {
loadAllDatas : loadAllDatas,
loadStage : loadStage,
getStageDataByID : getStageDataByID,
}
function loadAllDatas() {
this.loadStage(