static public void Destroy(string name) { GameObject obj = FindControl(name); if (obj != null) { obj.transform.parent = null; GameObject.Destroy(obj); AssetMgr.UnLoad(name); } }
static public void DestroyAll() { UIPanel[] panel = uiRoot.GetComponentsInChildren <UIPanel>(); for (int i = 0, imax = panel.Length; i < imax; ++i) { AssetMgr.UnLoad(panel[i].name); } GameObject.Destroy(uiRoot.gameObject); GameObject rt = GameObject.Find("_RealTime"); GameObject.Destroy(rt); }