static int SetTargetMinPanel(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); UnityEngine.GameObject arg0 = (UnityEngine.GameObject)ToLua.CheckObject(L, 1, typeof(UnityEngine.GameObject)); int arg1 = (int)LuaDLL.luaL_checknumber(L, 2); MonoExtendUtil.SetTargetMinPanel(arg0, arg1); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
/// <summary> /// 调整窗口层级 /// </summary> /// <param name="windowBase"></param> private void AdjustBaseWindowDepth(UIWindowBase windowBase) { UIWindowType type = windowBase.windowData.windowType; if (type == UIWindowType.Custom) { return; } int needDepth = 1; UIWindowShowMode windowMode = windowBase.windowData.showMode; switch (type) { case UIWindowType.Normal: { if (windowMode == UIWindowShowMode.DestoryOtherWindow) { needDepth = NORMAL_WINDOW_DEPTH; } else { needDepth = Mathf.Clamp(MonoExtendUtil.GetMaxTargetDepth(uiNormalWindowRoot.gameObject) + 1, NORMAL_WINDOW_DEPTH, int.MaxValue); } //Debug.Log("[UIWindowType.Normal] maxDepth is " + needDepth); } break; case UIWindowType.Fixed: { if (windowMode == UIWindowShowMode.DestoryOtherWindow) { needDepth = FIXED_WINDOW_DEPTH; } else { needDepth = Mathf.Clamp(MonoExtendUtil.GetMaxTargetDepth(uiFixedWidowRoot.gameObject) + 1, FIXED_WINDOW_DEPTH, int.MaxValue); } //Debug.Log("[UIWindowType.Fixed] max depth is " + needDepth); } break; case UIWindowType.PopUp: { if (windowMode == UIWindowShowMode.DestoryOtherWindow) { needDepth = POPUP_WINDOW_DEPTH; } else { needDepth = Mathf.Clamp(MonoExtendUtil.GetMaxTargetDepth(uiPopUpWindowRoot.gameObject) + 1, POPUP_WINDOW_DEPTH, int.MaxValue); } //Debug.Log("[UIWindowType.PopUp] maxDepth is " + needDepth); } break; } if (windowBase.MinDepth != needDepth) { MonoExtendUtil.SetTargetMinPanel(windowBase.gameObject, needDepth); } windowBase.MinDepth = needDepth; }