咸鱼的反击
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.
 
 
 
xianyudefanji/assets/Scripts/Manager/BaiCaoJiManager.ts

68 lines
2.1 KiB

import BagManager from "./BagManager";
import InterfaceManager from "./InterfaceManager";
export default class BaiCaoJiManager{
static gameConfigs = [];
static guShuGameConfigs = [];
public static getManagerConfigs(){
return this.gameConfigs
}
public static getGuShuManagerConfigs(){
return this.guShuGameConfigs
}
public static initManager(callFunc){
let self = this
cc.loader.loadRes('Json/gameConfig/baiCaoJi.json', function (err, gameconfig) {
if (err) {
console.log(err);
return;
}
self.gameConfigs = gameconfig.json;
// console.log("游戏配置加载成功", self.gameConfigs);
callFunc()
});
cc.loader.loadRes('Json/gameConfig/guShu.json', function (err, gameconfig) {
if (err) {
console.log(err);
return;
}
self.guShuGameConfigs = gameconfig.json;
});
}
public static getCurGoodList(){
//将任务/剧情道具替换掉最后的商品
//let daoYeList = InterfaceManager.getDaoyeList()
let replaceGoodsTab = []
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])
}
console.log('佰草集GoodList==',useConfig)
return useConfig
}
public static getGuShuCurGoodList(){
//将任务/剧情道具替换掉最后的商品
//let daoYeList = InterfaceManager.getDaoyeList()
let replaceGoodsTab = []
let useConfig = []
for(let i=0;i<this.guShuGameConfigs.length-replaceGoodsTab.length;i++){
useConfig.push(this.guShuGameConfigs[i])
}
for(let j=0;j<replaceGoodsTab.length;j++){
useConfig.push(replaceGoodsTab[j])
}
console.log('古树GoodList==',useConfig)
return useConfig
}
}