public override void OnLoadComplete(Transform obj) { base.OnLoadComplete(obj); //提示特效层级 UIPanelBase parent_component = GetComponentInParent <UIPanelBase>(); if (parent_component != null) { UIDepth effectDepth = gameObject.AddComponent <UIDepth>(); if (effectDepth != null) { effectDepth.SetOrder(parent_component.MaxSortingOrder + 1); parent_component.MaxSortingOrder++; } } }
public void SortRender() { if (m_WinObj != null) { Component[] depth = m_WinObj.GetComponentsInChildren(typeof(UIDepth)); if (depth != null) { int count = depth.Length; for (int i = 0; i < count; ++i) { UIDepth d = depth[i] as UIDepth; if (d != null) { d.SetOrder(m_RenderOrder + i); } } } } }