import FguiMgr from "../../../frameWork/fgui/FguiMgr"; import ClickAuEffect from "../../../utils/ClickAuEffect"; export default class PopUpFifthView { private MaskBg: fairygui.GButton; private CloseBtn: fairygui.GObject; private closeUI: any; public constructor(vm: fgui.GComponent) { this.MaskBg = vm.getChild("MaskBg").asButton; this.CloseBtn = vm.getChild("CloseBtn"); } public onEnable(): void { this.MaskBg.onClick(this.OnClickCloseBtn, this); this.CloseBtn.onClick(this.OnClickCloseBtn, this); } public onDisable(): void { this.MaskBg.offClick(this.OnClickCloseBtn, this); this.CloseBtn.offClick(this.OnClickCloseBtn, this); } /** * * @param closeUI 关闭的界面 */ setData(closeUI: any) { this.closeUI = closeUI; } // 关闭 @ClickAuEffect() private OnClickCloseBtn() { FguiMgr.Instance.closeUI(this.closeUI); } }