import BaseEvent from "../../fight/evnet/base/BaseEvent"; /** * 1-2 遇宠物,向天射箭的精灵族精灵 * 角色前进,遇到被关在地刺中的宠物。 小鹿:嗷嗷……嗷嗷…… */ const { ccclass, property } = cc._decorator; @ccclass export default class JG0111_2 extends BaseEvent { @property(cc.Node) mPet: cc.Node = null; @property(cc.Prefab) mMapDialog: cc.Prefab = null; @property({ displayName: '对话内容', type: [cc.String] }) text: Array = []; public isOver = false /** * 主角进入碰撞区域 * @param tag 碰撞组件编号 */ public onBegin(tag: number) { if(this.isOver){ return } this.isOver = true this.pause() this.moveCamera(this.mPet.getPosition(),0.7,()=>{ this.showDialog(this.mPet,this.text,()=>{ this.node.destroy() this.resume() }) }) } }