コード例 #1
0
        public bool ActiveWindow(string name)
        {
            lastTryOpenWindow = name;
            Init();
#if UNITY_EDITOR
            if (!m_WinBases.ContainsKey(name))
            {
                Debug.LogErrorFormat("Window \"{0}\" not found in this Manager", name);
            }
#endif
            if (_Now != null)
            {
                if (_Now.name == name || !CloseWindow(_Now.gameObject.name))
                {
                    return(false);
                }
            }
            if (m_WinBases.ContainsKey(name))
            {
                WindowsBase w = m_WinBases[name];
                bool        b = w.Active();
                if (b)
                {
                    //if(parent != null)
                    //    parent.child = this;
                    _Now = w;
                }
                return(b);
            }
            return(false);
        }
コード例 #2
0
        public void LoadPrev()
        {
            WindowsManager wm = LayerPeek();

            if (wm != this && wm.PrevState()) // (child.m_QueueWindows.Count > 0 || child._Now != null)
            {
                wm.LoadPrev();
                return;
            }

            /*if (child != null && child.gameObject.activeInHierarchy)
             * {
             *  if (child.PrevState()) // (child.m_QueueWindows.Count > 0 || child._Now != null)
             *  {
             *      child.LoadPrev();
             *      return;
             *  }
             * }*/
            bool b = true;

            if (_Now != null)
            {
                switch (LastPrevAction)
                {
                case LastPrev.CloseLastWindowNotCallONMLP:
                case LastPrev.CloseLastWindowCallONMLP:
                    if (!(b = CloseWindowWithOutHistory(_Now.gameObject.name)))
                    {
                        return;
                    }
                    break;

                case LastPrev.NotCloseLastWindowNotCallONMLP:
                case LastPrev.NotCloseLastWindowCallONMLP:
                    if (m_QueueWindows.Count > 0)
                    {
                        if (!(b = CloseWindowWithOutHistory(_Now.gameObject.name)))
                        {
                            return;
                        }
                    }
                    break;
                }
            }
            if (m_QueueWindows.Count > 0)
            {
                if (b)
                {
                    WindowsBase w = m_QueueWindows.Pop();
                    b = w.Active();
                    if (b)
                    {
                        _Now = w;
                    }
                }
            }
            else
            {
                if (b)
                {
                    if (((LastPrevAction == LastPrev.CloseLastWindowCallONMLP && _Now == null) || (LastPrevAction == LastPrev.NotCloseLastWindowCallONMLP && _Now != null)))
                    {
                        OnNoMoreLoadPrev.Invoke();
                    }
                    //child = null;
                }
            }
        }