IEnumerator InitWindowMgr() { yield return(new WaitForSeconds(Time.deltaTime)); var uiroot = GameObject.Find("UIRoot"); if (uiroot != null) { Destroy(uiroot); } GameObject gb = null; gb = (GameObject)ResourceMgr.GetInstantiateOB("UIRoot", ResType.UICommomType, ResCacheType.Always); gb.name = "UIRoot"; uiRootTrans = gb.transform; uiRootTrans.parent = transform; windowRootTrans = PEUITools.GetTrans(uiRootTrans, "windowRoot"); cameraRootTrans = PEUITools.GetTrans(uiRootTrans, "cameraRoot"); isInitDone = true; }