import EventListener from "../../../util/EventListener"; import FDialogNoneNPC from "../../fight/evnet/FDialogNoneNPC"; /** * 地图1 剧情1 */ const { ccclass, property } = cc._decorator; @ccclass export default class Step2 extends cc.Component { @property({ displayName: "稻草人", type: cc.Node, }) ncp_1: cc.Node = null; onLoad() { EventListener.on("step_2_1", this.dialog1, this); EventListener.on("step_2_2", this.dialog2, this); } onDestroy() { EventListener.off("step_2_1", this.dialog1, this); EventListener.off("step_2_2", this.dialog2, this); } dialog1() { let npc = this.ncp_1.getComponent(FDialogNoneNPC); npc.dialog1(); } dialog2() { let npc = this.ncp_1.getComponent(FDialogNoneNPC); npc.dialog2(); } }