diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleSimulateBuilder.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleSimulateBuilder.cs index 39c078f..90704b1 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleSimulateBuilder.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleSimulateBuilder.cs @@ -4,20 +4,18 @@ namespace YooAsset.Editor { public static class AssetBundleSimulateBuilder { - private static string _manifestFilePath = string.Empty; - /// /// 模拟构建 /// - public static void SimulateBuild() + public static string SimulateBuild(string packageName, bool enableAddressable) { string defaultOutputRoot = AssetBundleBuilderHelper.GetDefaultOutputRoot(); BuildParameters buildParameters = new BuildParameters(); buildParameters.OutputRoot = defaultOutputRoot; buildParameters.BuildTarget = EditorUserBuildSettings.activeBuildTarget; buildParameters.BuildMode = EBuildMode.SimulateBuild; - buildParameters.BuildPackage = AssetBundleBuilderSettingData.Setting.BuildPackage; - buildParameters.EnableAddressable = AssetBundleCollectorSettingData.Setting.EnableAddressable; + buildParameters.BuildPackage = packageName; + buildParameters.EnableAddressable = enableAddressable; AssetBundleBuilder builder = new AssetBundleBuilder(); var buildResult = builder.Run(buildParameters); @@ -25,20 +23,13 @@ namespace YooAsset.Editor { string pipelineOutputDirectory = AssetBundleBuilderHelper.MakePipelineOutputDirectory(buildParameters.OutputRoot, buildParameters.BuildPackage, buildParameters.BuildTarget, buildParameters.BuildMode); string manifestFileName = YooAssetSettingsData.GetPatchManifestFileName(buildParameters.BuildPackage, buildResult.OutputPackageCRC); - _manifestFilePath = $"{pipelineOutputDirectory}/{manifestFileName}"; + string manifestFilePath = $"{pipelineOutputDirectory}/{manifestFileName}"; + return manifestFilePath; } else { - _manifestFilePath = null; + return null; } } - - /// - /// 获取构建的补丁清单路径 - /// - public static string GetPatchManifestPath() - { - return _manifestFilePath; - } } } \ No newline at end of file