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.
52 lines
1.4 KiB
52 lines
1.4 KiB
1 week ago
|
import { ryw_Event } from "../../FrameWork/Event/EventEnum";
|
||
|
import EventMgr from "../../FrameWork/Event/EventMgr";
|
||
|
import ChatManager from "./ChatManager";
|
||
|
import JuQingManager from "./JuQingManager";
|
||
|
|
||
|
|
||
|
const {ccclass, property} = cc._decorator;
|
||
|
|
||
|
@ccclass
|
||
|
export default class DuiHuaQiPao extends cc.Component {
|
||
|
|
||
|
@property(cc.String)
|
||
|
curJsonName:string = ''
|
||
|
|
||
|
@property([cc.String])
|
||
|
curJuQingIndexStrTab:string[] = []
|
||
|
|
||
|
|
||
|
// onLoad () {}
|
||
|
|
||
|
start () {
|
||
|
this.setCurDuiHuaQiPaoVisible()
|
||
|
EventMgr.onEvent_custom(ryw_Event.RefreshJuQingDuiHua,()=>{
|
||
|
this.setCurDuiHuaQiPaoVisible()
|
||
|
},this)
|
||
|
}
|
||
|
|
||
|
onClickOpenDuiHua(){
|
||
|
let curJuQingUnLockIndex = JuQingManager.getCurJuQingUnLockIndex()
|
||
|
ChatManager.setSingleChatStatus('DH',this.curJsonName, curJuQingUnLockIndex, false)
|
||
|
//对话弹太快,给个延时
|
||
|
cc.tween(this.node)
|
||
|
.delay(0.5)
|
||
|
.call(()=>{
|
||
|
JuQingManager.openJuQingOrChat('DH',this.node)
|
||
|
})
|
||
|
.start()
|
||
|
|
||
|
}
|
||
|
//剧情气泡是否显示
|
||
|
setCurDuiHuaQiPaoVisible(){
|
||
|
let curJuQingUnLockIndex = JuQingManager.getCurJuQingUnLockIndex()
|
||
|
if(curJuQingUnLockIndex != '' && this.curJuQingIndexStrTab.indexOf(curJuQingUnLockIndex) > -1){
|
||
|
this.node.active = true
|
||
|
this.onClickOpenDuiHua()
|
||
|
}else{
|
||
|
this.node.active = false
|
||
|
}
|
||
|
}
|
||
|
// update (dt) {}
|
||
|
}
|