diff --git a/Assets/YooAsset/Runtime/InitializeParameters.cs b/Assets/YooAsset/Runtime/InitializeParameters.cs index b8daeb4..24b6017 100644 --- a/Assets/YooAsset/Runtime/InitializeParameters.cs +++ b/Assets/YooAsset/Runtime/InitializeParameters.cs @@ -4,11 +4,22 @@ namespace YooAsset /// /// 默认的构建管线 /// - public class DefaultBuildPipeline + public enum EDefaultBuildPipeline { - public const string BuiltinBuildPipelineName = "BuiltinBuildPipeline"; - public const string ScriptableBuildPipelineName = "ScriptableBuildPipeline"; - public const string RawFileBuildPipelineName = "RawFileBuildPipeline"; + /// + /// 内置构建管线 + /// + BuiltinBuildPipeline, + + /// + /// 可编程构建管线 + /// + ScriptableBuildPipeline, + + /// + /// 原生文件构建管线 + /// + RawFileBuildPipeline, } /// diff --git a/Assets/YooAsset/Runtime/ResourceManager/ResourceManager.cs b/Assets/YooAsset/Runtime/ResourceManager/ResourceManager.cs index 3d1f7e3..a7a8a3a 100644 --- a/Assets/YooAsset/Runtime/ResourceManager/ResourceManager.cs +++ b/Assets/YooAsset/Runtime/ResourceManager/ResourceManager.cs @@ -382,12 +382,12 @@ namespace YooAsset else { #if UNITY_WEBGL - if (bundleInfo.Bundle.Buildpipeline== DefaultBuildPipeline.RawFileBuildPipelineName) + if (bundleInfo.Bundle.Buildpipeline== EDefaultBuildPipeline.RawFileBuildPipeline.ToString()) loader = new RawBundleWebLoader(this, bundleInfo); else loader = new AssetBundleWebLoader(this, bundleInfo); #else - if (bundleInfo.Bundle.Buildpipeline == DefaultBuildPipeline.RawFileBuildPipelineName) + if (bundleInfo.Bundle.Buildpipeline == EDefaultBuildPipeline.RawFileBuildPipeline.ToString()) loader = new RawBundleFileLoader(this, bundleInfo); else loader = new AssetBundleFileLoader(this, bundleInfo); diff --git a/Assets/YooAsset/Runtime/ResourcePackage/PlayMode/EditorSimulateModeHelper.cs b/Assets/YooAsset/Runtime/ResourcePackage/PlayMode/EditorSimulateModeHelper.cs index 9f5d74f..bc3bf6b 100644 --- a/Assets/YooAsset/Runtime/ResourcePackage/PlayMode/EditorSimulateModeHelper.cs +++ b/Assets/YooAsset/Runtime/ResourcePackage/PlayMode/EditorSimulateModeHelper.cs @@ -19,6 +19,14 @@ namespace YooAsset return manifestFilePath; } + /// + /// 编辑器下模拟构建清单 + /// + public static string SimulateBuild(EDefaultBuildPipeline buildPipeline, string packageName) + { + return SimulateBuild(buildPipeline.ToString(), packageName); + } + private static object InvokePublicStaticMethod(System.Type type, string method, params object[] parameters) { var methodInfo = type.GetMethod(method, BindingFlags.Public | BindingFlags.Static); diff --git a/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs b/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs index 8d511a7..40a7c7c 100644 --- a/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs +++ b/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs @@ -1120,7 +1120,7 @@ namespace YooAsset [Conditional("DEBUG")] private void DebugCheckRawFileLoadMethod(string method) { - if (_playModeImpl.ActiveManifest.BuildPipeline != DefaultBuildPipeline.RawFileBuildPipelineName) + if (_playModeImpl.ActiveManifest.BuildPipeline != EDefaultBuildPipeline.RawFileBuildPipeline.ToString()) { throw new Exception($"Cannot load asset bundle file using {method} method !"); } @@ -1129,7 +1129,7 @@ namespace YooAsset [Conditional("DEBUG")] private void DebugCheckAssetLoadMethod(string method) { - if (_playModeImpl.ActiveManifest.BuildPipeline == DefaultBuildPipeline.RawFileBuildPipelineName) + if (_playModeImpl.ActiveManifest.BuildPipeline == EDefaultBuildPipeline.RawFileBuildPipeline.ToString()) { throw new Exception($"Cannot load raw file using {method} method !"); }