public override void Init(long _id) { base.Init(_id); uiLayer = new UGUILayerSolution(); uiLayer.Start(); MessageModule.instance.AddListener(MessageType.UILayersAddObject, AddObjectToLayer); MessageModule.instance.AddListener(MessageType.UILayersRemoveObject, RemoveObjectFromLayer); MessageModule.instance.AddListener(MessageType.UILayersRefresh, Refresh); }
public bool CanClose(IUILayer layer) { if (layer == null) { return(false); } UILayerType layerType = layer.LayerType; int maxDepth = GetCurrentLayerMaxDepth(layerType); return(layer.Depth >= maxDepth); }
// 设置层级 public void ShowLayer(IUILayer layer) { if (layer == null) { return; } UILayerType layerType = layer.LayerType; int maxDepth = GetCurrentLayerMaxDepth(layerType) + 1; layer.Depth = maxDepth; ChangeCurrentLayerMaxDepth(layerType, maxDepth); }