Exemplo n.º 1
0
    private void AdjustPageDepth(UIBasePanel mPage)
    {
        int needDepth = 1;

        if (mPage.UIPageProperty.WindowStyle == UIWindowStyle.Fixed)
        {
            needDepth = Mathf.Clamp(UIUtility.GetTargetMaxDepth(FixedWindowRoot.gameObject) + 1, UILayerConst.FixedDepth, int.MaxValue);
        }
        else if (mPage.UIPageProperty.WindowStyle == UIWindowStyle.Normal)
        {
            needDepth = Mathf.Clamp(UIUtility.GetTargetMaxDepth(NormalWindowRoot.gameObject) + 1, UILayerConst.NormalDepth, int.MaxValue);
        }
        else if (mPage.UIPageProperty.WindowStyle == UIWindowStyle.PopUp)
        {
            needDepth = Mathf.Clamp(UIUtility.GetTargetMaxDepth(PopupWindowRoot.gameObject) + 1, UILayerConst.PopUpDepth, int.MaxValue);
        }
        if (mPage.Depth != needDepth)
        {
            UIUtility.SetTargetMinPanelDepth(mPage.CacheGo, needDepth);
        }

        mPage.SetPageDepth(needDepth);
    }