T OnLoadDialog <T>(UIViewType ui, string uiName, string atlasList, PopupDialogType t, Transform parent, string richPath, object[] richPs, PopupDialogView.ButtonEventHandler btnEvent, object[] ps, PopupDialogView.DialogEventHandleer callback) where T : PopupDialogView { float sTime = Time.realtimeSinceStartup; GameObject uiObj = Instantiate(mUIList[uiName]) as GameObject; uiObj.name = uiName; uiObj.SetActive(true); T ret = uiObj.GetComponent <T>(); if (null != ret) { ret.UI类型 = ui; ret.SetWhiteBlockTex(WhiteBlockTex); if (null != callback) { callback(t, ret, parent, richPath, richPs, btnEvent, ps); } bool noNeedAtlas = true; string[] list = atlasList.Split("#".ToCharArray()); List <int> aidList = new List <int>(); for (int i = 0; i < list.Length; ++i) { if (string.IsNullOrEmpty(list[i])) { continue; } if (System.Enum.IsDefined(typeof(UIAtlasType), list[i])) { UIAtlasType at = (UIAtlasType)System.Enum.Parse(typeof(UIAtlasType), list[i]); noNeedAtlas = false; ret.AddRefAtlas(at); aidList.Add((int)at); } } if (noNeedAtlas) { ret.DoReadyShowing(); } else { for (int i = 0; i < aidList.Count; ++i) { StartCoroutine(DoLoadAtlas(aidList[i], ret)); } } } LogSys.Debug("~~~inst ui[" + uiName + "]used:" + (Time.realtimeSinceStartup - sTime).ToString()); return(ret); }
public static PopupDialogView LoadUIDialog(string uiName, string atlasList, PopupDialogType t, Transform parent, string richPath, object[] richPs, PopupDialogView.ButtonEventHandler btnEvent, object[] ps, PopupDialogView.DialogEventHandleer callback) { if (!FindManager()) { return(null); } return(Inst.OnLoadDialog <PopupDialogView>(UIViewType.弹出框, uiName, atlasList, t, parent, richPath, richPs, btnEvent, ps, callback)); }