perf : check build pipeline parameter type

pull/297/head
hevinci 2024-04-26 16:05:13 +08:00
parent a369efa429
commit bef90bf3b8
3 changed files with 27 additions and 6 deletions

View File

@ -8,8 +8,15 @@ namespace YooAsset.Editor
{
public BuildResult Run(BuildParameters buildParameters, bool enableLog)
{
AssetBundleBuilder builder = new AssetBundleBuilder();
return builder.Run(buildParameters, GetDefaultBuildPipeline(), enableLog);
if (buildParameters is BuiltinBuildParameters)
{
AssetBundleBuilder builder = new AssetBundleBuilder();
return builder.Run(buildParameters, GetDefaultBuildPipeline(), enableLog);
}
else
{
throw new Exception($"Invalid build parameter type : {buildParameters.GetType().Name}");
}
}
/// <summary>

View File

@ -11,8 +11,15 @@ namespace YooAsset.Editor
{
public BuildResult Run(BuildParameters buildParameters, bool enableLog)
{
AssetBundleBuilder builder = new AssetBundleBuilder();
return builder.Run(buildParameters, GetDefaultBuildPipeline(), enableLog);
if (buildParameters is RawFileBuildParameters)
{
AssetBundleBuilder builder = new AssetBundleBuilder();
return builder.Run(buildParameters, GetDefaultBuildPipeline(), enableLog);
}
else
{
throw new Exception($"Invalid build parameter type : {buildParameters.GetType().Name}");
}
}
/// <summary>

View File

@ -8,8 +8,15 @@ namespace YooAsset.Editor
{
public BuildResult Run(BuildParameters buildParameters, bool enableLog)
{
AssetBundleBuilder builder = new AssetBundleBuilder();
return builder.Run(buildParameters, GetDefaultBuildPipeline(), enableLog);
if (buildParameters is ScriptableBuildParameters)
{
AssetBundleBuilder builder = new AssetBundleBuilder();
return builder.Run(buildParameters, GetDefaultBuildPipeline(), enableLog);
}
else
{
throw new Exception($"Invalid build parameter type : {buildParameters.GetType().Name}");
}
}
/// <summary>