Exemple #1
0
    public void ShowWindow(WindowContextDataBase contextData = null)
    {
        if (baseView == null)
        {
            return;
        }
        baseView.SetActive(true);
        IsActive  = true;
        IsLoading = true;
        IsExiting = false;

        OnUIOpened();

        //处理动画
        DoEnteringAnimation(OnEnteringAnimationEnd);

        // this.RegisterReturnLogic(this.RetrunPreLogic);
    }
Exemple #2
0
    /// <summary>
    /// 处理窗口导航、互斥关系
    /// </summary>
    /// <param name="win"></param>
    /// <param name="open"></param>
    void DealWindowStack(UIViewBase win, bool open)
    {
        if (win.ShowMode != EWindowShowMode.HideOther)
        {
            return;
        }
        if (open)
        {
            if (m_MutexStacks.Count > 0)
            {
                UIViewBase w = m_MutexStacks[m_MutexStacks.Count - 1];
                for (int i = 0; i < m_OpenWindows.Count; i++)
                {
                    UIViewBase view = m_OpenWindows[i];
                    if (view.ShowMode == EWindowShowMode.SaveTarget && w.ID == view.TargetID)
                    {
                        view.SetActive(false);
                    }
                    if (view.Type == EWindowType.Window && view.ShowMode == EWindowShowMode.DoNothing)
                    {
                        view.Close();
                    }
                }
                w.SetActive(false);
            }
            m_MutexStacks.Add(win);
        }
        else
        {
            m_MutexStacks.Remove(win);
            for (int i = m_OpenWindows.Count - 1; i >= 0; i--)
            {
                UIViewBase view = m_OpenWindows[i];
                if (view.ShowMode == EWindowShowMode.SaveTarget && view.TargetID == win.ID)
                {
                    CloseWindow(view.ID);
                }
            }

            if (m_MutexStacks.Count > 0)
            {
                UIViewBase last = m_MutexStacks[m_MutexStacks.Count - 1];
                last.SetActive(true);
                for (int i = 0; i < m_OpenWindows.Count; i++)
                {
                    UIViewBase view = m_OpenWindows[i];
                    if (view.ShowMode == EWindowShowMode.SaveTarget && view.TargetID == last.ID)
                    {
                        view.SetActive(true);
                    }
                }
            }
        }
    }