PopUpForthView.ts 778 B

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