/// <summary> /// 关闭当前面板 /// </summary> protected void CloseThisPanel(PanelEffectType closeEffectType = PanelEffectType.Close) { if (this.ThisPanel == PanelType.None) { Debug.Log("this panel is none can't close!"); return; } UICtrller.Instance.ClosePanel(this.ThisPanel, closeEffectType); }
public void Open(PanelType type, PanelParamBase panelParam, PanelEffectType effectType, int depth) { this.ThisPanel = type; this.SetPanelDepth(depth); if (!this.IsInit) this.Init(); this.InitPanel(); this.Open(panelParam); this.PlayEffect(effectType); }
public void ClosePanel(PanelType type, PanelEffectType closeEffectType = PanelEffectType.Close) { if (this.m_OpenedPanelDic.ContainsKey(type)) { this.m_OpenedPanelDic[type].Close(closeEffectType); this.m_OpenedPanelDic.Remove(type); } else { Debug.LogError(type + " is null"); } }
public void Open(PanelType type, PanelParamBase panelParam, PanelEffectType effectType, int depth) { this.ThisPanel = type; this.SetPanelDepth(depth); if (!this.IsInit) { this.Init(); } this.InitPanel(); this.Open(panelParam); this.PlayEffect(effectType); }
private void PlayEffect(PanelEffectType type) { if (this.m_PanelEffect == null) { if (type == PanelEffectType.Close || type == PanelEffectType.CloseByOpenOther) { this.CloseComplete(); } else if (type == PanelEffectType.Open || type == PanelEffectType.OpenByCloseOther) { this.OpenComplete(); } } else { this.m_PanelEffect.Play(type); } }
public void Open(PanelType type, PanelParamBase panelParam = null, PanelEffectType openEffectType = PanelEffectType.Open) { PanelBase panel = null; int newDepth = 0; if (this.m_OpenedPanelDic.ContainsKey(type)) { panel = this.m_OpenedPanelDic[type]; newDepth = panel.GetDepth(); } else { panel = PoolMgr.Instance.GetPanel(type); if (panel == null) { Debug.Log("Panel is null " + type); return; } panel.MyTransform.localPosition = Vector3.zero; this.m_OpenedPanelDic.Add(type, panel); newDepth = this.GetTopDepth() + 2;//加2的原因是为了保险起见,因为有的时候只加1可能会出现面板重叠 } panel.Open(type, panelParam, openEffectType, newDepth); }
public void ClosePanel(PanelType type,PanelEffectType closeEffectType = PanelEffectType.Close) { if (this.m_OpenedPanelDic.ContainsKey(type)) { this.m_OpenedPanelDic[type].Close(closeEffectType); this.m_OpenedPanelDic.Remove(type); } else { Debug.LogError(type + " is null"); } }
public void Open(PanelType type, PanelParamBase panelParam = null,PanelEffectType openEffectType = PanelEffectType.Open) { PanelBase panel = null; int newDepth = 0; if (this.m_OpenedPanelDic.ContainsKey(type)) { panel = this.m_OpenedPanelDic[type]; newDepth = panel.GetDepth(); } else { panel = PoolMgr.Instance.GetPanel(type); if (panel == null) { Debug.Log("Panel is null " + type); return; } panel.MyTransform.localPosition = Vector3.zero; this.m_OpenedPanelDic.Add(type, panel); newDepth = this.GetTopDepth() + 2;//加2的原因是为了保险起见,因为有的时候只加1可能会出现面板重叠 } panel.Open(type,panelParam, openEffectType, newDepth); }
public virtual void Close(PanelEffectType type) { //在关闭面板时,禁用Collider,防止在播放动画的时候再次点到 UIUtils.SetUIColliderEnable(this.MyTransform, false); this.PlayEffect(type); }