public IEnumerator Load() { foreach (var item in GetDLCItemConfigs()) { DLCManager.LoadDLC(item); yield return(new WaitForEndOfFrame()); } //初始化的加载所有Bundle if (!DLCConfig.IsEditorMode) { if (DLCConfig.IsInitLoadSharedBundle) { foreach (var bundle in DLCManager.LoadAllSharedBundle()) { while (!bundle.IsDone) { yield return(new WaitForEndOfFrame()); } } } if (DLCConfig.IsInitLoadDirBundle) { foreach (var bundle in DLCManager.LoadAllDirBundle()) { while (!bundle.IsDone) { yield return(new WaitForEndOfFrame()); } } } } if (DLCConfig.IsWarmupAllShaders) { Shader.WarmupAllShaders(); } yield break; // 获得DLC的根目录 List <DLCItemConfig> GetDLCItemConfigs() { if (DLCConfig.IsEditorOrAssetBundleMode) { return(DLCConfig.ConfigAll); } else { List <DLCItemConfig> ret = new List <DLCItemConfig>(); string[] files = Directory.GetFiles(Const.Path_StreamingAssets, Const.STR_DLCItem + ".json", SearchOption.AllDirectories); foreach (var item in files) { ret.Add(FileUtil.LoadJson <DLCItemConfig>(item)); } return(ret); } } }