public override void Refresh() { base.Refresh(); for (var i = 0; i < panelList.Count; i++) { object panel = panelList[i]; int sortingOrder = uiLayerConfig.orderInLayer + (i + 1) * UILayerConst.Order_Per_Panel; if (panel is UIPanel uiPanel) { uiPanel.sortingOrder = sortingOrder; if (uiLayerConfig.uiLayerRule.IsHideLowerOrderUI()) { uiPanel.graphicComponent.SetIsShow(i == panelList.Count - 1); } } else //lua UIPanel { LuaTable panelLuaTable = (LuaTable)panel; panelLuaTable.InvokeAction("SetSortingOrder", sortingOrder); if (uiLayerConfig.uiLayerRule.IsHideLowerOrderUI()) { panelLuaTable.InvokeAction("graphicComponent.SetIsShow", i == panelList.Count - 1); } } } if (uiLayerConfig.uiLayerRule.IsHideBackgroundUILayer()) { this.Broadcast(null, UIEventNameConst.SetIsHideUILayer, EUILayerName.BackgroundUILayer, panelList.Count > 0); } if (uiLayerConfig.uiLayerRule.IsHideFrontUILayer()) { this.Broadcast(null, UIEventNameConst.SetIsHideUILayer, EUILayerName.FrontUILayer, panelList.Count > 0); } if (uiLayerConfig.uiLayerRule.IsAddBlackMaskBehind()) { HandleLayerAddBlackMaskBehind(); } }