Пример #1
0
    private void HideOtherWindow(UIWindowBase targetWindow)
    {
        UIWindowData windowData = targetWindow.windowData;

        List <UIWindowBase> sortedHiddenWindows = new List <UIWindowBase>();

        removedKey.Clear();

        var enumerator = showWindows.GetEnumerator();

        while (enumerator.MoveNext())
        {
            UIWindowBase window   = enumerator.Current.Value;
            int          windowId = enumerator.Current.Key;

            removedKey.Add(windowId);

            window.HideWindowDirectly();
            sortedHiddenWindows.Add(window);
        }

        // 从显示窗口集合移除
        for (int i = 0; i < removedKey.Count; i++)
        {
            showWindows.Remove(removedKey[i]);
        }

        // 根据窗口depath排序
        sortedHiddenWindows.Sort(compareWindowFun);

        List <int> navHiddenWindows = new List <int>();

        for (int i = 0; i < sortedHiddenWindows.Count; i++)
        {
            int pushWindowId = sortedHiddenWindows[i].WindowID;
            navHiddenWindows.Add(pushWindowId);
        }

        BackWindowSequenceData backData = new BackWindowSequenceData();

        backData.hideTargetWindow = targetWindow;
        backData.backShowTargets  = navHiddenWindows;
        backSequence.Push(backData);
        Debug.Log("<color=cyan>### !!!Push new Navigation data!!! ###</color>");
    }