protected override void OnDestroy() { base.OnDestroy(); ThisPanel = null; _KnownUI.Clear(); Instance = null; }
public void SetupUISorting(int layer, int base_order) { GameObject g = gameObject; Canvas root_canv = g.GetComponent <Canvas>(); if (root_canv == null) { root_canv = g.AddComponent <Canvas>(); } GNewUITools.SetupUILayerOrder(root_canv, base_order, layer, true); if (PanelInfoList != null && PanelInfoList.Length > 0) { for (int i = 0; i < PanelInfoList.Length; i++) { GameObject g_panel = PanelInfoList[i].Panel; if (!PanelInfoList[i].DontOverrideSorting) { Canvas canv = g_panel.GetComponent <Canvas>(); if (canv == null) { canv = g_panel.AddComponent <Canvas>(); } GNewUITools.SetupUILayerOrder(canv, PanelInfoList[i].OrderOffset + base_order, layer, PanelInfoList[i].IsNeedBlockRay); } } } //UI TODO: Cache usa? UISizeAdapter usa = g.GetComponentInParent <UISizeAdapter>(); if (usa != null) { usa.Register(g); } }
protected override void Awake() { base.Awake(); Instance = this; }