private void Preload() { PreloadData data = cityPreloadList[curLoadIndex]; UiRelationData relation = UiRelations.Instance.GetUiRelationData(data.uiType); UiUtility.LoadUiPerfab(data.uiType, relation.resourceName); data.loadState = PreloadState.Done; if (!CheckLoadOver()) { curLoadIndex++; Invoke("Preload", loadRate); } }
/// <summary> /// 这个创建ui, prefab本身已经绑定了脚本, 但是也没有调用BaseUi的BlandGameObjectLinkIfDidnt方法啊??? /// </summary> /// <param name="type"></param> /// <returns></returns> private BaseUi Create(Type type) { UiRelationData relation = UiRelations.Instance.GetUiRelationData(type); if (relation == null) { LoggerManager.Instance.Error("Create ui type: {0} cannot find.", type); return(null); } BaseUi ui = UiUtility.LoadUiPerfab(relation.type, relation.resourceName); if (ui != null) { ui.UiPanelName = relation.resourceName; InitUi(ui); } return(ui); }