Step2.ts 856 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. import EventListener from "../../../util/EventListener";
  2. import FDialogNoneNPC from "../../fight/evnet/FDialogNoneNPC";
  3. /**
  4. * 地图1 剧情1
  5. */
  6. const { ccclass, property } = cc._decorator;
  7. @ccclass
  8. export default class Step2 extends cc.Component {
  9. @property({
  10. displayName: "稻草人",
  11. type: cc.Node,
  12. })
  13. ncp_1: cc.Node = null;
  14. onLoad() {
  15. EventListener.on("step_2_1", this.dialog1, this);
  16. EventListener.on("step_2_2", this.dialog2, this);
  17. }
  18. onDestroy() {
  19. EventListener.off("step_2_1", this.dialog1, this);
  20. EventListener.off("step_2_2", this.dialog2, this);
  21. }
  22. dialog1() {
  23. let npc = this.ncp_1.getComponent(FDialogNoneNPC);
  24. npc.dialog1();
  25. }
  26. dialog2() {
  27. let npc = this.ncp_1.getComponent(FDialogNoneNPC);
  28. npc.dialog2();
  29. }
  30. }