// 再一次打开 public BaseView _again_open_panel(PanelInfo data) { BaseView baseView = _panelMap[data.ViewId]; baseView.SetPanelData(data.ViewId); return(baseView); }
public BaseView Open(PanelInfo viewInfo, System.Object info = null) { BaseView baseView = _internal_open(viewInfo); _panelCache.Set(viewInfo.ViewId, PanelHistoryInfo.Get(viewInfo.ViewId)); return(baseView); }
public void _internal_history_close(PanelInfo viewData, Action <BaseView> action = null) { if (OnClose != null) { OnClose(viewData, action); } }
public void _internal_history_open(PanelInfo viewData, Action <BaseView> action = null) { if (OnOpen != null) { OnOpen(viewData, action); } }
public void Close(PanelInfo viewInfo) { if (viewInfo == null) { return; } _internal_close(viewInfo); }
// 添加到历史记录并且打开 public void _internal_real_open(PanelInfo viewData, Object info, Action <BaseView> action = null) { _currView = viewData; PushHistory(viewData); if (OnOpen != null) { OnOpen(viewData, info, action); } }
// 剔除历史记录,并且关闭 public void _internal_real_close(PanelInfo viewData, Action <BaseView> action = null) { Remove(viewData); _currView = PeekHistory(); if (OnClose != null) { OnClose(viewData, action); } }
private static void _init_view_data(E_ViewId id, E_PanelType type, string pfbName, E_PanelBgType showMode = E_PanelBgType.NOTHING, bool hasBgClickClose = true) { PanelInfo view = new PanelInfo(id, type, ResPath.Get(PathType.PANEL_PFB, pfbName)); view._showMode = showMode; view._hasBgClickClose = hasBgClickClose; ViewPrefabMap.Add(id, view); _viewCount++; }
public void Open(PanelInfo viewData, Object info, Action <BaseView> action = null) { if (viewData.IsPanel() && _currView != null) { for (int i = _panelHistory.Count - 1; i >= 0; i--) { _internal_history_close(_panelHistory[i]); } } _internal_real_open(viewData, info, action); //PanelLog.Log("-->当前界面:[{0}]",_curr_view.ViewId); }
public void _real_open(PanelInfo viewData, System.Object info = null, Action <BaseView> action = null) { BaseView baseView = _panelFactory.Open(viewData, info); if (action != null) { action(baseView); } baseView.gameObject.SetActive(false); GameObjectHelper.SetParent(baseView.gameObject, _panelCanvas.gameObject, true); baseView.gameObject.SetActive(true); }
public void _internal_close(PanelInfo data) { E_ViewId viewId = data.ViewId; if (!_panelMap.ContainsKey(viewId)) { return; } BaseView baseView = _panelMap[viewId]; baseView.OnExit(); GameObjectHelper.SetActive(baseView.gameObject, false); }
public bool Remove(PanelInfo viewData) { for (int i = _panelHistory.Count - 1; i >= 0; i--) { if (viewData == _panelHistory[i]) { PanelLog.Log("Remove :[{0}]", viewData.ViewId); _panelHistory.RemoveAt(i); return(true); } } return(false); }
public PanelInfo PopHistory() { PanelInfo viewData = null; if (_panelHistory.Count > 0) { viewData = _panelHistory[_panelHistory.Count - 1]; PanelLog.Log("Remove :[{0}]", viewData.ViewId); _panelHistory.RemoveAt(_panelHistory.Count - 1); } return(viewData); }
public BaseView _internal_open(PanelInfo data) { if (data == null) { return(null); } E_ViewId viewId = data.ViewId; BaseView baseView = !_panelMap.ContainsKey(viewId) ? _first_open_panel(data) : _again_open_panel(data); baseView.OnEnter(); GameObjectHelper.SetActive(baseView.gameObject, true); return(baseView); }
// 第一次打开界面的相关步骤 public BaseView _first_open_panel(PanelInfo data) { E_ViewId viewId = data.ViewId; // 2.加载GameObject 并且 _instantiate GameObject go = ResManager.instance.LoadPrefab(data.GetPfbName); BaseView baseView = go.GetComponent <BaseView>(); // 3.Instantiate //view = _instantiate(obj, data); // 4.view的额外操作 //base_view.OpenExtraOpertion(data); baseView.SetPanelData(viewId); // 6.添加到层 //_add_layer(view.gameObject); baseView.OnInit(); // 5.view的额外data //base_view.SetPanelData(data); // 8.添加到缓存 _panelMap.Add(viewId, baseView); return(baseView); }
public void _internal_close(E_ViewId viewId) { if (_internal_close_top_view(viewId)) { return; } PanelInfo tmpData = _currView; int index = _panelHistory.Count - 1; while (_panelHistory.Count >= 1 && tmpData != null) { if (tmpData.IsPanel()) { _internal_history_open(tmpData); break; } _internal_history_close(tmpData); index--; tmpData = _panelHistory[index]; } }
public void Destory(PanelInfo info) { if (info == null) { return; } BaseView baseView; _panelMap.TryGetValue(info.ViewId, out baseView); E_ViewId viewId = info.ViewId; if (baseView == null) { return; } _panelMap.Remove(viewId); baseView.OnDestroySelf(); GameObjectHelper.DestroySelf(baseView.gameObject); ResLoader.Instance.UnLoadRes(info.GetPfbName); }
public void OnOpen(E_ViewId viewId, System.Object info = null, Action <BaseView> action = null) { PanelInfo viewData = PanelManagerConfig.Get(viewId); _panelHistoryStack.Open(viewData, info); }
public void _real_close(PanelInfo viewData, System.Object info = null, Action <BaseView> action = null) { _panelFactory.Close(viewData); }
public void PushHistory(PanelInfo viewData) { PanelLog.Log("Add :[{0}]", viewData.ViewId); _panelHistory.Add(viewData); }
public void OnRemoveValueEvent(E_ViewId viewId) { PanelInfo viewData = PanelManagerConfig.Get(viewId); Destory(viewData); }