public static T GetUIRoot <T>(string _uiName) where T : UIRootBase { if (UIRootDict.ContainsKey(_uiName)) { return(UIRootDict[_uiName] as T); } return(null); }
public static T CreateUIRoot <T>(string _uiName, UILayer _layer) where T : UIRootBase { GameObject _go = GameResourcesManager.LoadUIPrefab(_uiName); //_go.transform.SetParent(GetUILayer(_layer).transform, false); T _uiRoot = _go.GetComponent <T>(); _uiRoot.rootID = _uiName; UIRootDict.Add(_uiRoot.rootID, _uiRoot); return(_uiRoot); }