diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildPipeline/BuiltinBuildPipeline/BuiltinBuildPipeline.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildPipeline/BuiltinBuildPipeline/BuiltinBuildPipeline.cs index 2ac4058..177803f 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildPipeline/BuiltinBuildPipeline/BuiltinBuildPipeline.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildPipeline/BuiltinBuildPipeline/BuiltinBuildPipeline.cs @@ -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}"); + } } /// diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildPipeline/RawFileBuildPipeline/RawFileBuildPipeline.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildPipeline/RawFileBuildPipeline/RawFileBuildPipeline.cs index 7865150..e220a0b 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildPipeline/RawFileBuildPipeline/RawFileBuildPipeline.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildPipeline/RawFileBuildPipeline/RawFileBuildPipeline.cs @@ -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}"); + } } /// diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildPipeline/ScriptableBuildPipeline/ScriptableBuildPipeline.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildPipeline/ScriptableBuildPipeline/ScriptableBuildPipeline.cs index db62db6..1e87ab9 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildPipeline/ScriptableBuildPipeline/ScriptableBuildPipeline.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildPipeline/ScriptableBuildPipeline/ScriptableBuildPipeline.cs @@ -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}"); + } } ///