public CnPanelObj GetTopView() { CnPanelObj ret = null; if (this._viewStack.Count > 0) { ret = this._viewStack.Last(); } return(ret); }
public bool CanUnload(CnPanelObj view) { if (this._viewStack.Contains(view)) { return(true); } else { ZLog.E(null, "{0} no view {1}_{2}", this._root.name, view.GetName(), view.ZOrder); } return(false);// this.IsTop(view); }
public void InitNewPanel(CnPanelObj view, GameObject ins, bool show, params object[] args) { view.InitArgs(_viewID, ins, this, args); _viewID++; if (show) { DoShow(view); } else { DoHide(view); } }
//implement IViewMgr public bool DestoryView(CnPanelObj view) { bool isTop = this.IsTop(view); this._viewStack.Remove(view); if (isTop) { CnPanelObj next = this.GetTopView(); if (next != null) { next.DoBring2Top(view); } } GameObject.Destroy(view.UIObj); return(true); }
public bool DoHide(CnPanelObj view) { bool ret = false; if (this._viewStack.Contains(view)) { bool isTop = this.IsTop(view); this._viewStack.Remove(view); if (isTop) { CnPanelObj next = this.GetTopView(); if (next != null) { next.DoBring2Top(view); } } } this._initViewSet.Add(view); view.UIObj.SetActive(false); ret = true; return(ret); }
public bool DoShow(CnPanelObj view) { bool ret = false; do { CnPanelObj last_view = this.GetTopView(); this._viewStack.Add(view); if (last_view != null) { last_view.OnBehind(view); } if (this._initViewSet.Contains(view)) { this._initViewSet.Remove(view); //ZLog.E(null, "{0} no init view {1}_{2}", this._thisCanvas.name, view.GetName(), view.ZOrder); //break; } view.UIObj.SetActive(true); ret = true; }while(false); return(ret); }
} //从顶层移到后一层 public override void OnTop(CnPanelObj topview) { this.view.OnTop(topview); } //从后层变到顶层
} //移除前调用 public override void OnBehind(CnPanelObj topview) { this.view.OnBehind(topview); } //从顶层移到后一层
} //从顶层移到后一层 public virtual void OnTop(CnPanelObj topview) { } //从后层变到顶层
} //移除前调用 public virtual void OnBehind(CnPanelObj topview) { } //从顶层移到后一层
public void DoBring2Top(CnPanelObj view) { this.OnTop(view); }
public bool IsTop(CnPanelObj view) { return(view == this.GetTopView()); }