PopUpFifthView.ts 975 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. import FguiMgr from "../../../frameWork/fgui/FguiMgr";
  2. import ClickAuEffect from "../../../utils/ClickAuEffect";
  3. export default class PopUpFifthView {
  4. private MaskBg: fairygui.GButton;
  5. private CloseBtn: fairygui.GObject;
  6. private closeUI: any;
  7. public constructor(vm: fgui.GComponent) {
  8. this.MaskBg = vm.getChild("MaskBg").asButton;
  9. this.CloseBtn = vm.getChild("CloseBtn");
  10. }
  11. public onEnable(): void {
  12. this.MaskBg.onClick(this.OnClickCloseBtn, this);
  13. this.CloseBtn.onClick(this.OnClickCloseBtn, this);
  14. }
  15. public onDisable(): void {
  16. this.MaskBg.offClick(this.OnClickCloseBtn, this);
  17. this.CloseBtn.offClick(this.OnClickCloseBtn, this);
  18. }
  19. /**
  20. *
  21. * @param closeUI 关闭的界面
  22. */
  23. setData(closeUI: any) {
  24. this.closeUI = closeUI;
  25. }
  26. // 关闭
  27. @ClickAuEffect()
  28. private OnClickCloseBtn() {
  29. FguiMgr.Instance.closeUI(this.closeUI);
  30. }
  31. }