diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleBuilder.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleBuilder.cs index 9c66058..8e29424 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleBuilder.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleBuilder.cs @@ -30,8 +30,8 @@ namespace YooAsset.Editor PipelineOutputDirectory = AssetBundleBuilderHelper.MakePipelineOutputDirectory(parameters.OutputRoot, parameters.BuildTarget); if (parameters.BuildMode == EBuildMode.DryRunBuild) PipelineOutputDirectory += $"_{EBuildMode.DryRunBuild}"; - else if(parameters.BuildMode == EBuildMode.FastRunBuild) - PipelineOutputDirectory += $"_{EBuildMode.FastRunBuild}"; + else if(parameters.BuildMode == EBuildMode.SimulateBuild) + PipelineOutputDirectory += $"_{EBuildMode.SimulateBuild}"; } /// @@ -53,7 +53,7 @@ namespace YooAsset.Editor BuildAssetBundleOptions opt = BuildAssetBundleOptions.None; opt |= BuildAssetBundleOptions.StrictMode; //Do not allow the build to succeed if any errors are reporting during it. - if (Parameters.BuildMode == EBuildMode.FastRunBuild) + if (Parameters.BuildMode == EBuildMode.SimulateBuild) { throw new Exception("Should never get here !"); } @@ -132,7 +132,7 @@ namespace YooAsset.Editor new TaskCopyBuildinFiles(), //拷贝内置文件 }; - if (buildParameters.BuildMode == EBuildMode.FastRunBuild) + if (buildParameters.BuildMode == EBuildMode.SimulateBuild) BuildRunner.EnableLog = false; else BuildRunner.EnableLog = true; diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleRuntimeBuilder.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleSimulateBuilder.cs similarity index 74% rename from Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleRuntimeBuilder.cs rename to Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleSimulateBuilder.cs index a010830..b5a80d4 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleRuntimeBuilder.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleSimulateBuilder.cs @@ -1,22 +1,21 @@ -using System; -using UnityEditor; +using UnityEditor; namespace YooAsset.Editor { - public static class AssetBundleRuntimeBuilder + public static class AssetBundleSimulateBuilder { private static string _manifestFilePath = string.Empty; /// - /// 快速模式构建 + /// 模拟构建 /// - public static void FastBuild() + public static void SimulateBuild() { string defaultOutputRoot = AssetBundleBuilderHelper.GetDefaultOutputRoot(); BuildParameters buildParameters = new BuildParameters(); buildParameters.OutputRoot = defaultOutputRoot; buildParameters.BuildTarget = EditorUserBuildSettings.activeBuildTarget; - buildParameters.BuildMode = EBuildMode.FastRunBuild; + buildParameters.BuildMode = EBuildMode.SimulateBuild; buildParameters.BuildVersion = AssetBundleBuilderSettingData.Setting.BuildVersion; buildParameters.BuildinTags = AssetBundleBuilderSettingData.Setting.BuildTags; buildParameters.EnableAddressable = AssetBundleCollectorSettingData.Setting.EnableAddressable; @@ -26,7 +25,7 @@ namespace YooAsset.Editor if (buildResult) { string pipelineOutputDirectory = AssetBundleBuilderHelper.MakePipelineOutputDirectory(buildParameters.OutputRoot, buildParameters.BuildTarget); - _manifestFilePath = $"{pipelineOutputDirectory}_{EBuildMode.FastRunBuild}/{YooAssetSettingsData.GetPatchManifestFileName(buildParameters.BuildVersion)}"; + _manifestFilePath = $"{pipelineOutputDirectory}_{EBuildMode.SimulateBuild}/{YooAssetSettingsData.GetPatchManifestFileName(buildParameters.BuildVersion)}"; } else { @@ -35,9 +34,9 @@ namespace YooAsset.Editor } /// - /// 获取构建的补丁清单文件路径 + /// 获取构建的补丁清单路径 /// - public static string GetPatchManifestFilePath() + public static string GetPatchManifestPath() { return _manifestFilePath; } diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleRuntimeBuilder.cs.meta b/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleSimulateBuilder.cs.meta similarity index 100% rename from Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleRuntimeBuilder.cs.meta rename to Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleSimulateBuilder.cs.meta diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildMapCreater.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildMapCreater.cs index 0ff3610..faf5935 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildMapCreater.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildMapCreater.cs @@ -10,7 +10,7 @@ namespace YooAsset.Editor /// /// 执行资源构建上下文 /// - public static BuildMapContext CreateBuildMap() + public static BuildMapContext CreateBuildMap(EBuildMode buildMode) { BuildMapContext context = new BuildMapContext(); Dictionary buildAssetDic = new Dictionary(1000); @@ -19,7 +19,7 @@ namespace YooAsset.Editor AssetBundleCollectorSettingData.Setting.CheckConfigError(); // 2. 获取所有主动收集的资源 - List allCollectAssets = AssetBundleCollectorSettingData.Setting.GetAllCollectAssets(); + List allCollectAssets = AssetBundleCollectorSettingData.Setting.GetAllCollectAssets(buildMode); // 3. 剔除未被引用的依赖资源 List removeDependList = new List(); diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskBuilding.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskBuilding.cs index 8d43a86..ed31245 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskBuilding.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskBuilding.cs @@ -21,9 +21,9 @@ namespace YooAsset.Editor var buildParametersContext = context.GetContextObject(); var buildMapContext = context.GetContextObject(); - // 快速构建模式下跳过引擎构建 + // 模拟构建模式下跳过引擎构建 var buildMode = buildParametersContext.Parameters.BuildMode; - if (buildMode == EBuildMode.FastRunBuild) + if (buildMode == EBuildMode.SimulateBuild) return; BuildAssetBundleOptions opt = buildParametersContext.GetPipelineBuildOptions(); diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskGetBuildMap.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskGetBuildMap.cs index 285846d..7105b49 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskGetBuildMap.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskGetBuildMap.cs @@ -12,7 +12,8 @@ namespace YooAsset.Editor { void IBuildTask.Run(BuildContext context) { - var buildMapContext = BuildMapCreater.CreateBuildMap(); + var buildParametersContext = context.GetContextObject(); + var buildMapContext = BuildMapCreater.CreateBuildMap(buildParametersContext.Parameters.BuildMode); context.SetContextObject(buildMapContext); BuildRunner.Log("构建内容准备完毕!"); diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskVerifyBuildResult.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskVerifyBuildResult.cs index 2b124ef..44a6bf9 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskVerifyBuildResult.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskVerifyBuildResult.cs @@ -15,8 +15,8 @@ namespace YooAsset.Editor { var buildParametersContext = context.GetContextObject(); - // 快速构建模式下跳过验证 - if (buildParametersContext.Parameters.BuildMode == EBuildMode.FastRunBuild) + // 模拟构建模式下跳过验证 + if (buildParametersContext.Parameters.BuildMode == EBuildMode.SimulateBuild) return; // 验证构建结果 diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/EBuildMode.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/EBuildMode.cs index deb8757..ae6da7a 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/EBuildMode.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/EBuildMode.cs @@ -16,14 +16,14 @@ namespace YooAsset.Editor /// IncrementalBuild, - /// - /// 快速构建模式 - /// - FastRunBuild, - /// /// 演练构建模式 /// DryRunBuild, + + /// + /// 模拟构建模式 + /// + SimulateBuild, } } \ No newline at end of file diff --git a/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollector.cs b/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollector.cs index 1716a8b..536325b 100644 --- a/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollector.cs +++ b/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollector.cs @@ -235,6 +235,10 @@ namespace YooAsset.Editor } private List GetAllDependencies(string mainAssetPath) { + // 注意:模拟构建模式下不需要收集依赖资源 + if(AssetBundleCollectorSetting.BuildMode == EBuildMode.SimulateBuild) + return new List(); + List result = new List(); string[] depends = AssetDatabase.GetDependencies(mainAssetPath, true); foreach (string assetPath in depends) diff --git a/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollectorSetting.cs b/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollectorSetting.cs index 65239d7..59570e7 100644 --- a/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollectorSetting.cs +++ b/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollectorSetting.cs @@ -8,6 +8,8 @@ namespace YooAsset.Editor { public class AssetBundleCollectorSetting : ScriptableObject { + public static EBuildMode BuildMode; + /// /// 是否启用可寻址资源定位 /// @@ -43,8 +45,10 @@ namespace YooAsset.Editor /// /// 获取打包收集的资源文件 /// - public List GetAllCollectAssets() + public List GetAllCollectAssets(EBuildMode buildMode) { + BuildMode = buildMode; + Dictionary result = new Dictionary(10000); // 收集打包资源 diff --git a/Assets/YooAsset/Editor/ShaderVariantCollector/ShaderVariantCollector.cs b/Assets/YooAsset/Editor/ShaderVariantCollector/ShaderVariantCollector.cs index 880b3e8..d895e32 100644 --- a/Assets/YooAsset/Editor/ShaderVariantCollector/ShaderVariantCollector.cs +++ b/Assets/YooAsset/Editor/ShaderVariantCollector/ShaderVariantCollector.cs @@ -98,7 +98,7 @@ namespace YooAsset.Editor List allAssets = new List(1000); // 获取所有打包的资源 - List allCollectInfos = AssetBundleCollectorSettingData.Setting.GetAllCollectAssets(); + List allCollectInfos = AssetBundleCollectorSettingData.Setting.GetAllCollectAssets(EBuildMode.DryRunBuild); List collectAssets = allCollectInfos.Select(t => t.AssetPath).ToList(); foreach (var assetPath in collectAssets) { diff --git a/Assets/YooAsset/Runtime/PatchSystem/Operations/InitializationOperation.cs b/Assets/YooAsset/Runtime/PatchSystem/Operations/InitializationOperation.cs index 212cd0e..636c260 100644 --- a/Assets/YooAsset/Runtime/PatchSystem/Operations/InitializationOperation.cs +++ b/Assets/YooAsset/Runtime/PatchSystem/Operations/InitializationOperation.cs @@ -13,9 +13,9 @@ namespace YooAsset } /// - /// 编辑器下模拟运行的初始化操作 + /// 编辑器下模拟模式的初始化操作 /// - internal sealed class EditorPlayModeInitializationOperation : InitializationOperation + internal sealed class EditorSimulateModeInitializationOperation : InitializationOperation { private enum ESteps { @@ -24,10 +24,10 @@ namespace YooAsset Done, } - private readonly EditorPlayModeImpl _impl; + private readonly EditorSimulateModeImpl _impl; private ESteps _steps = ESteps.None; - internal EditorPlayModeInitializationOperation(EditorPlayModeImpl impl) + internal EditorSimulateModeInitializationOperation(EditorSimulateModeImpl impl) { _impl = impl; } @@ -39,7 +39,7 @@ namespace YooAsset { if (_steps == ESteps.Builder) { - string manifestFilePath = EditorPlayModeHelper.DryRunBuild(); + string manifestFilePath = EditorSimulateModeHelper.SimulateBuild(); if (string.IsNullOrEmpty(manifestFilePath)) { _steps = ESteps.Done; @@ -65,7 +65,7 @@ namespace YooAsset } /// - /// 离线模式的初始化操作 + /// 离线运行模式的初始化操作 /// internal sealed class OfflinePlayModeInitializationOperation : InitializationOperation { @@ -116,7 +116,7 @@ namespace YooAsset } /// - /// 网络模式的初始化操作 + /// 网络运行模式的初始化操作 /// internal sealed class HostPlayModeInitializationOperation : InitializationOperation { diff --git a/Assets/YooAsset/Runtime/PatchSystem/PlayMode/EditorPlayModeHelper.cs b/Assets/YooAsset/Runtime/PatchSystem/PlayMode/EditorSimulateModeHelper.cs similarity index 67% rename from Assets/YooAsset/Runtime/PatchSystem/PlayMode/EditorPlayModeHelper.cs rename to Assets/YooAsset/Runtime/PatchSystem/PlayMode/EditorSimulateModeHelper.cs index 02c40e9..b050f93 100644 --- a/Assets/YooAsset/Runtime/PatchSystem/PlayMode/EditorPlayModeHelper.cs +++ b/Assets/YooAsset/Runtime/PatchSystem/PlayMode/EditorSimulateModeHelper.cs @@ -3,19 +3,19 @@ using System.Reflection; namespace YooAsset { - internal static class EditorPlayModeHelper + internal static class EditorSimulateModeHelper { private static System.Type _classType; - public static string DryRunBuild() + public static string SimulateBuild() { - _classType = Assembly.Load("YooAsset.Editor").GetType("YooAsset.Editor.AssetBundleRuntimeBuilder"); - InvokePublicStaticMethod(_classType, "FastBuild"); + _classType = Assembly.Load("YooAsset.Editor").GetType("YooAsset.Editor.AssetBundleSimulateBuilder"); + InvokePublicStaticMethod(_classType, "SimulateBuild"); return GetPatchManifestFilePath(); } private static string GetPatchManifestFilePath() { - return (string)InvokePublicStaticMethod(_classType, "GetPatchManifestFilePath"); + return (string)InvokePublicStaticMethod(_classType, "GetPatchManifestPath"); } private static object InvokePublicStaticMethod(System.Type type, string method, params object[] parameters) { @@ -30,8 +30,8 @@ namespace YooAsset } } #else - internal static class EditorPlayModeHelper + internal static class EditorSimulateModeHelper { - public static string DryRunBuild() { throw new System.Exception("Only support in unity editor !"); } + public static string SimulateBuild() { throw new System.Exception("Only support in unity editor !"); } } #endif \ No newline at end of file diff --git a/Assets/YooAsset/Runtime/PatchSystem/PlayMode/EditorPlayModeHelper.cs.meta b/Assets/YooAsset/Runtime/PatchSystem/PlayMode/EditorSimulateModeHelper.cs.meta similarity index 100% rename from Assets/YooAsset/Runtime/PatchSystem/PlayMode/EditorPlayModeHelper.cs.meta rename to Assets/YooAsset/Runtime/PatchSystem/PlayMode/EditorSimulateModeHelper.cs.meta diff --git a/Assets/YooAsset/Runtime/PatchSystem/PlayMode/EditorPlayModeImpl.cs b/Assets/YooAsset/Runtime/PatchSystem/PlayMode/EditorSimulateModeImpl.cs similarity index 92% rename from Assets/YooAsset/Runtime/PatchSystem/PlayMode/EditorPlayModeImpl.cs rename to Assets/YooAsset/Runtime/PatchSystem/PlayMode/EditorSimulateModeImpl.cs index 2d6b883..33b47f0 100644 --- a/Assets/YooAsset/Runtime/PatchSystem/PlayMode/EditorPlayModeImpl.cs +++ b/Assets/YooAsset/Runtime/PatchSystem/PlayMode/EditorSimulateModeImpl.cs @@ -4,7 +4,7 @@ using System.Collections.Generic; namespace YooAsset { - internal class EditorPlayModeImpl : IBundleServices + internal class EditorSimulateModeImpl : IBundleServices { internal PatchManifest AppPatchManifest; @@ -13,7 +13,7 @@ namespace YooAsset /// public InitializationOperation InitializeAsync() { - var operation = new EditorPlayModeInitializationOperation(this); + var operation = new EditorSimulateModeInitializationOperation(this); OperationSystem.ProcessOperaiton(operation); return operation; } diff --git a/Assets/YooAsset/Runtime/PatchSystem/PlayMode/EditorPlayModeImpl.cs.meta b/Assets/YooAsset/Runtime/PatchSystem/PlayMode/EditorSimulateModeImpl.cs.meta similarity index 100% rename from Assets/YooAsset/Runtime/PatchSystem/PlayMode/EditorPlayModeImpl.cs.meta rename to Assets/YooAsset/Runtime/PatchSystem/PlayMode/EditorSimulateModeImpl.cs.meta diff --git a/Assets/YooAsset/Runtime/YooAssets.cs b/Assets/YooAsset/Runtime/YooAssets.cs index 38154c9..cc83d60 100644 --- a/Assets/YooAsset/Runtime/YooAssets.cs +++ b/Assets/YooAsset/Runtime/YooAssets.cs @@ -14,17 +14,18 @@ namespace YooAsset public enum EPlayMode { /// - /// 编辑器下模拟运行模式 + /// 编辑器下的模拟模式 + /// 注意:在初始化的时候自动构建真机运行环境。 /// - EditorPlayMode, - + EditorSimulateMode, + /// - /// 离线模式 + /// 离线运行模式 /// OfflinePlayMode, /// - /// 网络模式 + /// 网络运行模式 /// HostPlayMode, } @@ -56,21 +57,21 @@ namespace YooAsset } /// - /// 编辑器下模拟运行模式参数 + /// 编辑器下模拟运行模式的初始化参数 /// - public class EditorPlayModeParameters : CreateParameters + public class EditorSimulateModeParameters : CreateParameters { } /// - /// 离线模式参数 + /// 离线运行模式的初始化参数 /// public class OfflinePlayModeParameters : CreateParameters { } /// - /// 网络模式参数 + /// 网络运行模式的初始化参数 /// public class HostPlayModeParameters : CreateParameters { @@ -102,7 +103,7 @@ namespace YooAsset private static EPlayMode _playMode; private static IBundleServices _bundleServices; private static ILocationServices _locationServices; - private static EditorPlayModeImpl _editorPlayModeImpl; + private static EditorSimulateModeImpl _editorSimulateModeImpl; private static OfflinePlayModeImpl _offlinePlayModeImpl; private static HostPlayModeImpl _hostPlayModeImpl; @@ -151,8 +152,8 @@ namespace YooAsset } // 运行模式 - if (parameters is EditorPlayModeParameters) - _playMode = EPlayMode.EditorPlayMode; + if (parameters is EditorSimulateModeParameters) + _playMode = EPlayMode.EditorSimulateMode; else if (parameters is OfflinePlayModeParameters) _playMode = EPlayMode.OfflinePlayMode; else if (parameters is HostPlayModeParameters) @@ -176,12 +177,12 @@ namespace YooAsset // 初始化资源系统 InitializationOperation initializeOperation; - if (_playMode == EPlayMode.EditorPlayMode) + if (_playMode == EPlayMode.EditorSimulateMode) { - _editorPlayModeImpl = new EditorPlayModeImpl(); - _bundleServices = _editorPlayModeImpl; + _editorSimulateModeImpl = new EditorSimulateModeImpl(); + _bundleServices = _editorSimulateModeImpl; AssetSystem.Initialize(true, parameters.AssetLoadingMaxNumber, parameters.DecryptionServices, _bundleServices); - initializeOperation = _editorPlayModeImpl.InitializeAsync(); + initializeOperation = _editorSimulateModeImpl.InitializeAsync(); } else if (_playMode == EPlayMode.OfflinePlayMode) { @@ -223,7 +224,7 @@ namespace YooAsset public static UpdateStaticVersionOperation UpdateStaticVersionAsync(int timeout = 60) { DebugCheckInitialize(); - if (_playMode == EPlayMode.EditorPlayMode) + if (_playMode == EPlayMode.EditorSimulateMode) { var operation = new EditorPlayModeUpdateStaticVersionOperation(); OperationSystem.ProcessOperaiton(operation); @@ -255,7 +256,7 @@ namespace YooAsset public static UpdateManifestOperation UpdateManifestAsync(int resourceVersion, int timeout = 60) { DebugCheckInitialize(); - if (_playMode == EPlayMode.EditorPlayMode) + if (_playMode == EPlayMode.EditorSimulateMode) { var operation = new EditorPlayModeUpdateManifestOperation(); OperationSystem.ProcessOperaiton(operation); @@ -285,11 +286,11 @@ namespace YooAsset public static int GetResourceVersion() { DebugCheckInitialize(); - if (_playMode == EPlayMode.EditorPlayMode) + if (_playMode == EPlayMode.EditorSimulateMode) { - if (_editorPlayModeImpl == null) + if (_editorSimulateModeImpl == null) throw new Exception("YooAsset is not initialized."); - return _editorPlayModeImpl.GetResourceVersion(); + return _editorSimulateModeImpl.GetResourceVersion(); } else if (_playMode == EPlayMode.OfflinePlayMode) { @@ -574,7 +575,7 @@ namespace YooAsset string bundleName = _bundleServices.GetBundleName(assetPath); BundleInfo bundleInfo = _bundleServices.GetBundleInfo(bundleName); - if (_playMode == EPlayMode.EditorPlayMode) + if (_playMode == EPlayMode.EditorSimulateMode) { RawFileOperation operation = new EditorPlayModeRawFileOperation(bundleInfo, copyPath); OperationSystem.ProcessOperaiton(operation); @@ -635,7 +636,7 @@ namespace YooAsset public static PatchDownloaderOperation CreatePatchDownloader(string[] tags, int downloadingMaxNumber, int failedTryAgain) { DebugCheckInitialize(); - if (_playMode == EPlayMode.EditorPlayMode || _playMode == EPlayMode.OfflinePlayMode) + if (_playMode == EPlayMode.EditorSimulateMode || _playMode == EPlayMode.OfflinePlayMode) { List downloadList = new List(); var operation = new PatchDownloaderOperation(downloadList, downloadingMaxNumber, failedTryAgain); @@ -661,7 +662,7 @@ namespace YooAsset public static PatchDownloaderOperation CreatePatchDownloader(int downloadingMaxNumber, int failedTryAgain) { DebugCheckInitialize(); - if (_playMode == EPlayMode.EditorPlayMode || _playMode == EPlayMode.OfflinePlayMode) + if (_playMode == EPlayMode.EditorSimulateMode || _playMode == EPlayMode.OfflinePlayMode) { List downloadList = new List(); var operation = new PatchDownloaderOperation(downloadList, downloadingMaxNumber, failedTryAgain); @@ -689,7 +690,7 @@ namespace YooAsset public static PatchDownloaderOperation CreateBundleDownloader(string[] locations, int downloadingMaxNumber, int failedTryAgain) { DebugCheckInitialize(); - if (_playMode == EPlayMode.EditorPlayMode || _playMode == EPlayMode.OfflinePlayMode) + if (_playMode == EPlayMode.EditorSimulateMode || _playMode == EPlayMode.OfflinePlayMode) { List downloadList = new List(); var operation = new PatchDownloaderOperation(downloadList, downloadingMaxNumber, failedTryAgain); @@ -723,7 +724,7 @@ namespace YooAsset public static PatchDownloaderOperation CreateBundleDownloader(AssetInfo[] assetInfos, int downloadingMaxNumber, int failedTryAgain) { DebugCheckInitialize(); - if (_playMode == EPlayMode.EditorPlayMode || _playMode == EPlayMode.OfflinePlayMode) + if (_playMode == EPlayMode.EditorSimulateMode || _playMode == EPlayMode.OfflinePlayMode) { List downloadList = new List(); var operation = new PatchDownloaderOperation(downloadList, downloadingMaxNumber, failedTryAgain); @@ -770,7 +771,7 @@ namespace YooAsset public static PatchUnpackerOperation CreatePatchUnpacker(string[] tags, int unpackingMaxNumber, int failedTryAgain) { DebugCheckInitialize(); - if (_playMode == EPlayMode.EditorPlayMode) + if (_playMode == EPlayMode.EditorSimulateMode) { List downloadList = new List(); var operation = new PatchUnpackerOperation(downloadList, unpackingMaxNumber, failedTryAgain); @@ -804,7 +805,7 @@ namespace YooAsset public static UpdatePackageOperation UpdatePackageAsync(int resourceVersion, int timeout = 60) { DebugCheckInitialize(); - if (_playMode == EPlayMode.EditorPlayMode) + if (_playMode == EPlayMode.EditorSimulateMode) { var operation = new EditorPlayModeUpdatePackageOperation(); OperationSystem.ProcessOperaiton(operation); @@ -876,7 +877,11 @@ namespace YooAsset // 轮询更新资源系统 AssetSystem.Update(); } - internal static string MappingToAssetPath(string location) + + /// + /// 资源定位地址转换为资源完整路径 + /// + public static string MappingToAssetPath(string location) { DebugCheckLocation(location); return _bundleServices.MappingToAssetPath(location);