예제 #1
0
        public UIWindow GetAnyShowWindow(UIWindowGroup group, UIWindow exludeWindow)
        {
            if (Instance == null)
            {
                return(null);
            }

            List <UIWindow> wins = Instance.m_WindowList;

            for (int index = 0; index < wins.Count; ++index)
            {
                UIWindow win = wins[index];
                if (win.windowGroup == group && win.IsShow())
                {
                    if (exludeWindow != null && exludeWindow == win)
                    {
                        continue;
                    }

                    return(win);
                }
            }

            return(null);
        }
예제 #2
0
        //---------------------------------------------------------------------
        public static void HideGroup(UIWindowGroup winGroup,
                                     Action <object> handler, params object[] data)
        {
            string s = null;

            HideGroup(winGroup, s, handler, data);
        }
예제 #3
0
        //---------------------------------------------------------------------
        public int GetShowCount(UIWindowGroup group, bool includeHiding)
        {
            if (Instance == null)
            {
                return(0);
            }

            List <UIWindow> wins             = Instance.m_WindowList;
            int             currentShowCount = 0;

            for (int index = 0; index < wins.Count; ++index)
            {
                UIWindow win = wins[index];
                if (win.windowGroup == group && win.IsShow())
                {
                    if (!includeHiding && win.IsHiding())
                    {
                        continue;
                    }

                    currentShowCount++;
                }
            }

            return(currentShowCount);
        }
예제 #4
0
 //---------------------------------------------------------------------
 public void AddMutexGroup(UIWindowGroup group)
 {
     if (!ms_MutexGroups.Contains(group))
     {
         ms_MutexGroups.Add(group);
     }
 }
예제 #5
0
        public void ShutdownGroup(UIWindowGroup group, List <string> excludeList)
        {
            if (excludeList != null)
            {
                for (int i = 0; i < excludeList.Count; ++i)
                {
                    excludeList[i] = excludeList[i];
                }
            }

            UIWindow[] windows = Windows(group);
            for (int index = 0; index < windows.Length; ++index)
            {
                string winName = windows[index].WindowName;
                if (excludeList != null && excludeList.Contains(winName))
                {
                    continue;
                }

                if (!Shutdown(winName))
                {
                    LOG.Warning("Shutdown '" + winName + "' failed.");
                }
            }
        }
예제 #6
0
        //---------------------------------------------------------------------
        public static void ShowGroup(UIWindowGroup winGroup,
                                     Action <object> handler, params object[] data)
        {
            List <UIWindow> winList            = Instance.m_WindowList;
            int             totalWinCount      = winList.Count;
            int             alreadyWindowCount = 0;

            for (int index = 0; index < winList.Count; ++index)
            {
                UIWindow win = winList[index];
                if (win.windowGroup == winGroup)
                {
                    if (handler == null)
                    {
                        win.Show();
                        continue;
                    }

                    Action postShowHandler = null;
                    postShowHandler = delegate() {
                        win.PostShowEvent -= postShowHandler;
                        alreadyWindowCount++;
                        if (alreadyWindowCount >= totalWinCount)
                        {
                            handler(data);
                        }
                    };
                    win.PostShowEvent += postShowHandler;
                    win.Show();
                }
            }
        }
 public OpenUIWindowInfo(int serialId, UIWindowGroup uiWindowGroup, bool pauseCovered, UIWindowContext uiWindowContext)
 {
     this.serialId = serialId;
     this.uiWindowGroup = uiWindowGroup;
     this.pauseCovered = pauseCovered;
     this.uiWindowContext = uiWindowContext;
 }
예제 #8
0
        //---------------------------------------------------------------------
        public void RemoveRollbackGroup(UIWindowGroup group)
        {
            if (Instance == null)
            {
                return;
            }

            Instance.m_RollbackGroupList.Remove(group);
        }
예제 #9
0
        //---------------------------------------------------------------------
        public UIWindow[] Windows(UIWindowGroup group)
        {
            if (Instance == null)
            {
                return(null);
            }

            return(Instance.GetWindows(group));
        }
예제 #10
0
        //---------------------------------------------------------------------
        public void AddRollbackGroup(UIWindowGroup group)
        {
            if (Instance == null)
            {
                return;
            }

            if (!Instance.m_RollbackGroupList.Contains(group))
            {
                Instance.m_RollbackGroupList.Add(group);
            }
        }
예제 #11
0
        //---------------------------------------------------------------------
        private UIWindow[] GetWindows(UIWindowGroup group)
        {
            List <UIWindow> windows = new List <UIWindow>();

            for (int index = 0; index < Instance.m_WindowList.Count; ++index)
            {
                UIWindow win = Instance.m_WindowList[index];
                if (win.windowGroup == group)
                {
                    windows.Add(win);
                }
            }

            return(windows.ToArray());
        }
예제 #12
0
 public static void HideGroup(UIWindowGroup winGroup, string exclusiveWinName)
 {
     HideGroup(winGroup, exclusiveWinName, null, null);
 }
예제 #13
0
 //---------------------------------------------------------------------
 public static void ShowGroup(UIWindowGroup winGroup)
 {
     ShowGroup(winGroup, null, null);
 }
예제 #14
0
 //---------------------------------------------------------------------
 public void ShutdownGroup(UIWindowGroup group)
 {
     ShutdownGroup(group, null);
 }
예제 #15
0
 //---------------------------------------------------------------------
 public void ClearMutexGroup(UIWindowGroup group)
 {
     ms_MutexGroups.Clear();
 }
예제 #16
0
 //---------------------------------------------------------------------
 public bool ContainsMutexGroup(UIWindowGroup group)
 {
     return(ms_MutexGroups.Contains(group));
 }
예제 #17
0
        //---------------------------------------------------------------------
        //private bool PlayWindowAnimation(RequestType nextRequest, bool isShow) {
        //    RequestBatch batch = LastRequestBatch();
        //    if (batch != null) {
        //        // Only one animation playing.
        //        if (batch.type == RequestType.ShowAnimation ||
        //            batch.type == RequestType.HideAnimation) {
        //            return false;
        //        }
        //    }

        //    RequestType requestType = isShow ?
        //        RequestType.ShowAnimation : RequestType.HideAnimation;

        //    int totalAnimationCount = 0;
        //    AnimationOrTween.Trigger conditionTrigger = isShow ?
        //        AnimationOrTween.Trigger.OnActivateTrue :
        //        AnimationOrTween.Trigger.OnActivateFalse;
        //    for (int index = 0; index < m_WindowAnimations.Length; ++index) {
        //        UIPlayTween playTween = m_WindowAnimations[index];
        //        if (playTween.trigger != conditionTrigger ||
        //            !playTween.enabled || !playTween.gameObject.activeSelf ||
        //            playTween.tweenTarget == null) {
        //            continue;
        //        }

        //        UITweener[] childTweens = null;
        //        if (playTween.includeChildren) {
        //            childTweens = playTween.tweenTarget.GetComponentsInChildren<UITweener>();
        //        } else {
        //            childTweens = playTween.tweenTarget.GetComponents<UITweener>();
        //        }

        //        int ownTweenerCount = 0;
        //        for (int i = 0; i < childTweens.Length; ++i) {
        //            if (childTweens[i].tweenGroup == playTween.tweenGroup) {
        //                ownTweenerCount++;
        //            }
        //        }

        //        if (ownTweenerCount == 0) {
        //            continue;
        //        }

        //        ++totalAnimationCount;
        //        EventDelegate finishedCallback = null;
        //        object[] lastDataArray = null;
        //        if (requestDataArray != null && requestDataArray.Length != 0) {
        //            lastDataArray = new object[requestDataArray.Length];
        //            Array.Copy(requestDataArray, lastDataArray, lastDataArray.Length);
        //        }

        //        finishedCallback = new EventDelegate(delegate() {
        //            playTween.onFinished.Remove(finishedCallback);
        //            --totalAnimationCount;
        //            if (totalAnimationCount <= 0) {
        //                RemoveRequestBatch(requestType);
        //                PushRequest(nextRequest, lastDataArray);
        //            }
        //        });
        //        playTween.onFinished.Add(finishedCallback);
        //    }

        //    if (totalAnimationCount == 0) {
        //        return false;
        //    }

        //    PushRequest(requestType, requestDataArray);

        //    // iTween toggle message
        //    gameObject.SendMessage("OnActivate", isShow,
        //        SendMessageOptions.DontRequireReceiver);

        //    return true;
        //}

        //---------------------------------------------------------------------
        public int GetPanelDepth(UIWindowGroup group)
        {
            return(10 * (int)group);
        }
예제 #18
0
        //---------------------------------------------------------------------
        public static void HideGroup(UIWindowGroup winGroup)
        {
            string s = null;

            HideGroup(winGroup, s, null, null);
        }