Step2.ts 791 B

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