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.
57 lines
2.2 KiB
57 lines
2.2 KiB
1 week ago
|
import User from "../../FrameWork/User/User";
|
||
|
import GameBaseScript from "../GameRoomRes/GameBaseScript";
|
||
|
import TaskManager, { MainTaskIdEnum } from "../JuQingChat/TaskManager";
|
||
|
import UserManager from "../Manager/UserManager";
|
||
|
import PrefabManage, { GameType } from "../PrefabManager/PrefabManage";
|
||
|
import GetAward from "../SCommon/GetAward";
|
||
|
import DHBase from "./DHBase";
|
||
|
const { ccclass, property } = cc._decorator;
|
||
|
|
||
|
@ccclass
|
||
|
export default class DH_1 extends DHBase {
|
||
|
chatConfig = [
|
||
|
{ effectUrl: 'DH/DH_1/sound/机关盒?里面藏了什么东西呢?', delayTime: 3, str: '机关盒?里面藏了什么东西呢?', posi: '-1' },
|
||
|
]
|
||
|
|
||
|
start() {
|
||
|
GameBaseScript.preLoadRemoteAudioByChatConfig(this.chatConfig);
|
||
|
super.start();
|
||
|
this.continueStory();
|
||
|
// this.scheduleOnce(() => {
|
||
|
// PrefabManage.preloadPrefabByType(GameType.DH_29)
|
||
|
// })
|
||
|
}
|
||
|
|
||
|
// 继续剧情
|
||
|
continueStory() {
|
||
|
this.scheduleOnce(() => {
|
||
|
PrefabManage.preloadPrefabByType(GameType.DH_2)
|
||
|
})
|
||
|
const dialogEvents = [
|
||
|
(func) => {
|
||
|
this.showQiPao(this.chatConfig[this.dialogIndex++], func);
|
||
|
},
|
||
|
]
|
||
|
const dialogCallFunc = (logEvents: any[]) => {
|
||
|
logEvents.shift()(() => {
|
||
|
if (logEvents.length > 0) {
|
||
|
dialogCallFunc(logEvents);
|
||
|
} else {
|
||
|
// PrefabManage.loadPrefabByType(GameType.GetAward, null, (prefabNode) => {
|
||
|
// let goods = [{ goodId: 1733, goodNum: 1 }];
|
||
|
// prefabNode.getComponent(GetAward).initView(goods, () => {
|
||
|
// // TaskManager.finishCurMainTask(MainTaskIdEnum.MainTask_530)
|
||
|
// // User.setRoomGoodStatus("DH_29")
|
||
|
// // UserManager.clearAndaddStructureFlash("cf_FengRenYuan")
|
||
|
// });
|
||
|
// });
|
||
|
TaskManager.finishCurMainTask(MainTaskIdEnum.MainTask_202)
|
||
|
TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_203)
|
||
|
this.node.destroy()
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
dialogCallFunc(dialogEvents);
|
||
|
}
|
||
|
}
|