public void Close(UI ui) { for (int i = ui.UIContainer.childCount - 1; i > -1; i--) { UI subUI = ui.UIContainer.GetChild(i).GetComponent <UI>(); Close(subUI); } AssetsAgent.DestroyGameObject(ui.gameObject); }
public UI Open(string uiName, IUIContainer container) { UI ui = AssetsAgent.GetGameObject(uiName, container.UIContainer).GetComponent <UI>(); if (ui.Canvas.isRootCanvas) { ui.Canvas.sortingOrder = ui.transform.GetSiblingIndex(); } ui.Parent = container; return(ui); }