private void OnHideEnd() { log.Debug("{0} HideEnd", name); InputBlocker.Hide(this); eventReg.DeregisterEvents(); try { PostClose(); } catch (Exception e) { log.Error(e); } if (tabs != null) { tabs.CloseAndResetTab(); } PopupCallback callback = closeCallback; this.closeCallback = null; releasables.Release(); if (callback != null) { callback(); } if (onHideEnd != null) { onHideEnd(); } if (!shared) { Object.Destroy(go); } }
public void SetVisible(bool visible) { if (uiRoot == null) { return; } if (!tabButton.isEnabled == visible) { return; } tabButton.SetButtonActive(!visible); if (visible) { GetComponentInParent <UIPanel>().ArrangeRenderQueue(); GetContents(seed, () => { // tab selection may be changed after GetContents() is called if (!tabButton.isEnabled) { PreOpen(); eventReg.RegisterEvents(); uiRoot.SetActive(true); if (buttons != null) { buttons.enabled = true; } SetContents(); NGUIUtil.Reposition(transform); } }); } else { if (tabButton.isEnabled) { uiRoot.SetActive(false); if (buttons != null) { buttons.enabled = false; } eventReg.DeregisterEvents(); PostClose(); } } TabSelectChange(visible); }