Define the Window core data 1. windowType 2. showMode 3. colliderMode !!You must init the window's core data in the InitWindowData !!
Example #1
0
        private void RefreshBackSequenceData(UIBaseWindow targetWindow, ShowWindowData showData)
        {
            WindowCoreData coreData         = targetWindow.windowData;
            bool           dealBackSequence = true;

            if (dicShownWindows.Count > 0 && dealBackSequence)
            {
                List <WindowID>     removedKey          = null;
                List <UIBaseWindow> sortedHiddenWindows = new List <UIBaseWindow>();

                BackWindowSequenceData backData = new BackWindowSequenceData();
                foreach (KeyValuePair <int, UIBaseWindow> window in dicShownWindows)
                {
                    if (coreData.showMode != UIWindowShowMode.DoNothing)
                    {
                        if (window.Value.windowData.windowType == UIWindowType.Fixed)
                        {
                            continue;
                        }
                        if (removedKey == null)
                        {
                            removedKey = new List <WindowID>();
                        }
                        removedKey.Add((WindowID)window.Key);
                        window.Value.HideWindowDirectly();
                    }

                    if (window.Value.windowData.windowType != UIWindowType.Fixed)
                    {
                        sortedHiddenWindows.Add(window.Value);
                    }
                }

                if (removedKey != null)
                {
                    for (int i = 0; i < removedKey.Count; i++)
                    {
                        dicShownWindows.Remove((int)removedKey[i]);
                    }
                }

                // Push new navigation data
                if (coreData.navigationMode == UIWindowNavigationMode.NormalNavigation &&
                    (showData == null || (!showData.ignoreAddNavData)))
                {
                    // Add to return show target list
                    sortedHiddenWindows.Sort(this.compareWindowFun);
                    List <WindowID> navHiddenWindows = new List <WindowID>();
                    for (int i = 0; i < sortedHiddenWindows.Count; i++)
                    {
                        WindowID pushWindowId = sortedHiddenWindows[i].ID;
                        navHiddenWindows.Add(pushWindowId);
                    }
                    backData.hideTargetWindow = targetWindow;
                    backData.backShowTargets  = navHiddenWindows;
                    backSequence.Push(backData);
                    Debuger.Log("<color=cyan>### !!!Push new Navigation data!!! ###</color>");
                }
            }
        }
Example #2
0
        private void ExecuteNavigationLogic(UIBaseWindow baseWindow, ShowWindowData showData)
        {
            WindowCoreData windowData = baseWindow.windowData;

            if (baseWindow.RefreshBackSeqData)
            {
                this.RefreshBackSequenceData(baseWindow, showData);
            }
            else if (windowData.showMode == UIWindowShowMode.HideOtherWindow)
            {
                HideAllShownWindow();
            }

            // If target window is mark as force clear all the navigation sequence data
            // Show data need force clear the back seq data
            if (baseWindow.windowData.forceClearNavigation || (showData != null && showData.forceClearBackSeqData))
            {
                Debuger.Log("<color=cyan>## [Enter the start window, reset the backSequenceData for the navigation system.]##</color>");
                ClearBackSequence();
            }
            else
            {
                if ((showData != null && showData.checkNavigation))
                {
                    CheckBackSequenceData(baseWindow);
                }
            }
        }