|
@@ -19,13 +19,17 @@ export class GameUI extends BaseUI {
|
|
|
let getGameJson = () => {
|
|
|
return PathUtils.addGP('data_' + [Data.game.semeID, Data.game.gameID, Data.game.partID].join('_'))
|
|
|
}
|
|
|
- let getBgAniJson = () => {
|
|
|
- let arr = [Data.game.semeYear, Data.game.gameID]
|
|
|
+ let getBgAniJson = async (isSemeYear: boolean) => {
|
|
|
+ let key = isSemeYear ? Data.game.semeYear : Data.game.semeID
|
|
|
+ let arr = [key, Data.game.gameID]
|
|
|
if (Data.game.curGameType == GAME_TYPE.gameEndless) arr.push(Data.game.partID)
|
|
|
- return 'bgAni/' + Data.game.semeYear + '/bgAni_' + arr.join('_')
|
|
|
+ let url = 'bgAni/' + key + '/bgAni_' + arr.join('_')
|
|
|
+ let jsonAsset: cc.JsonAsset = await this.loadSync(Data.game.gameBundle, url, cc.JsonAsset)
|
|
|
+ return jsonAsset
|
|
|
}
|
|
|
let gameJson: cc.JsonAsset = await this.loadSync(Data.game.semeBundle, getGameJson(), cc.JsonAsset)
|
|
|
- let bgAniJson: cc.JsonAsset = await this.loadSync(Data.game.gameBundle, getBgAniJson(), cc.JsonAsset)
|
|
|
+ let bgAniJson: cc.JsonAsset = await getBgAniJson(true)
|
|
|
+ if (!bgAniJson) bgAniJson = await getBgAniJson(false)
|
|
|
// 防止因异步加载json产生关卡显示错乱
|
|
|
if (gameJson && getGameJson().includes(gameJson.name)) {
|
|
|
let json = gameJson.json
|