觉醒时刻
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
juexingshike/assets/Scripts/JiuPingHuiShou/JiuPingHuiShouManager.ts

54 lines
1.7 KiB

1 week ago
import InterfaceManager from "../../Scripts/Manager/InterfaceManager";
export default class JiuPingHuiShouManager{
static gameConfigs = [];
public static getManagerConfigs(){
return this.gameConfigs
}
public static initManager(callFunc){
let self = this
cc.loader.loadRes('Json/gameConfig/jiupinghuishou.json', function (err, gameconfig) {
if (err) {
console.log(err);
return;
}
self.gameConfigs = gameconfig.json;
// console.log("游戏配置加载成功", self.gameConfigs);
callFunc()
});
}
public static getCurGoodList(){
//将任务/剧情道具替换掉最后的商品
let daoYeList = InterfaceManager.getDaoyeList()
let replaceGoodsTab = []
// for(let i=0;i<daoYeList.length;i++){
// let goodId = daoYeList[i].goodId
// if((daoYeList[i].gameType == '宠物馆' || daoYeList[i].gameType == '宠物馆') && BagManager.getBagGoodNums(goodId) <= 0){
// replaceGoodsTab.push(BagManager.getJuQingGoodConfig(goodId))
// }
// }
// let mainTaskInfo:any = TaskManager.getCurUnLockMainTaskInfo()
// let mainId = mainTaskInfo.Id
// if(mainId == MainTaskIdEnum.MainTask_554){
// let goodInfo = BagManager.getJuQingGoodConfig(2707)
// replaceGoodsTab.push(goodInfo)
// }
let useConfig = []
for(let i=0;i<this.gameConfigs.length-replaceGoodsTab.length;i++){
useConfig.push(this.gameConfigs[i])
}
for(let j=0;j<replaceGoodsTab.length;j++){
useConfig.push(replaceGoodsTab[j])
}
return useConfig
}
}