update resource package

pull/189/head
hevinci 2023-10-11 14:36:02 +08:00
parent 1313e05d5d
commit 9476bbe562
4 changed files with 27 additions and 8 deletions

View File

@ -4,11 +4,22 @@ namespace YooAsset
/// <summary> /// <summary>
/// 默认的构建管线 /// 默认的构建管线
/// </summary> /// </summary>
public class DefaultBuildPipeline public enum EDefaultBuildPipeline
{ {
public const string BuiltinBuildPipelineName = "BuiltinBuildPipeline"; /// <summary>
public const string ScriptableBuildPipelineName = "ScriptableBuildPipeline"; /// 内置构建管线
public const string RawFileBuildPipelineName = "RawFileBuildPipeline"; /// </summary>
BuiltinBuildPipeline,
/// <summary>
/// 可编程构建管线
/// </summary>
ScriptableBuildPipeline,
/// <summary>
/// 原生文件构建管线
/// </summary>
RawFileBuildPipeline,
} }
/// <summary> /// <summary>

View File

@ -382,12 +382,12 @@ namespace YooAsset
else else
{ {
#if UNITY_WEBGL #if UNITY_WEBGL
if (bundleInfo.Bundle.Buildpipeline== DefaultBuildPipeline.RawFileBuildPipelineName) if (bundleInfo.Bundle.Buildpipeline== EDefaultBuildPipeline.RawFileBuildPipeline.ToString())
loader = new RawBundleWebLoader(this, bundleInfo); loader = new RawBundleWebLoader(this, bundleInfo);
else else
loader = new AssetBundleWebLoader(this, bundleInfo); loader = new AssetBundleWebLoader(this, bundleInfo);
#else #else
if (bundleInfo.Bundle.Buildpipeline == DefaultBuildPipeline.RawFileBuildPipelineName) if (bundleInfo.Bundle.Buildpipeline == EDefaultBuildPipeline.RawFileBuildPipeline.ToString())
loader = new RawBundleFileLoader(this, bundleInfo); loader = new RawBundleFileLoader(this, bundleInfo);
else else
loader = new AssetBundleFileLoader(this, bundleInfo); loader = new AssetBundleFileLoader(this, bundleInfo);

View File

@ -19,6 +19,14 @@ namespace YooAsset
return manifestFilePath; return manifestFilePath;
} }
/// <summary>
/// 编辑器下模拟构建清单
/// </summary>
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) private static object InvokePublicStaticMethod(System.Type type, string method, params object[] parameters)
{ {
var methodInfo = type.GetMethod(method, BindingFlags.Public | BindingFlags.Static); var methodInfo = type.GetMethod(method, BindingFlags.Public | BindingFlags.Static);

View File

@ -1120,7 +1120,7 @@ namespace YooAsset
[Conditional("DEBUG")] [Conditional("DEBUG")]
private void DebugCheckRawFileLoadMethod(string method) 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 !"); throw new Exception($"Cannot load asset bundle file using {method} method !");
} }
@ -1129,7 +1129,7 @@ namespace YooAsset
[Conditional("DEBUG")] [Conditional("DEBUG")]
private void DebugCheckAssetLoadMethod(string method) 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 !"); throw new Exception($"Cannot load raw file using {method} method !");
} }