public void OpenWindow(string uiName, EWindowLayer layer) { if (!groupMap.ContainsKey(layer)) { Debug.LogError("找不到指定的层级:" + layer); return; } groupMap[layer].OpenUIWnd(uiName); groupMap[layer].RefreshDepth(); }
public void SetRoot(Transform root) { foreach (Transform t in root) { int depth = t.GetSiblingIndex(); EWindowLayer layer = (EWindowLayer)depth; UIGroup uiGroup = new UIGroup(layer, t, depth); groupMap.Add(layer, uiGroup); } }
// 排序深度 private void OnSortWindowDepth(EWindowLayer layer) { int depth = (int)layer; for (int i = 0; i < _stack.Count; i++) { if (_stack[i].WindowLayer == layer) { _stack[i].Depth = depth; depth += 100; //注意:每次递增100深度 } } }
private bool IsTopWindow(EWindowType type, EWindowLayer layer) { UIWindow lastOne = null; for (int i = 0; i < _stack.Count; i++) { if (_stack[i].WindowLayer == layer) { lastOne = _stack[i]; } } if (lastOne == null) { return(false); } return(lastOne.WindowType == type); }
// 刷新可见性 private void OnSetWindowVisible(EWindowLayer layer) { bool isHideNext = false; for (int i = _stack.Count - 1; i >= 0; i--) { UIWindow window = _stack[i]; if (window.WindowLayer == layer) { if (isHideNext == false) { window.IsVisible = true; if (window.IsPrepare && window.IsOpen && window.FullScreen) { isHideNext = true; } } else { window.IsVisible = false; } } } }
public void Init(EWindowType type, EWindowLayer layer) { WindowType = type; WindowLayer = layer; }
public UIGroup(EWindowLayer layer, Transform root, int groupDepth) { Layer = layer; Root = root; GroupDepth = groupDepth; }
public WindowAttribute(EWindowType type, EWindowLayer layer) { WindowType = type; WindowLayer = layer; }