Update editor code

pull/51/head
hevinci 2022-09-29 18:40:51 +08:00
parent a71921cdd1
commit 6549fbb552
1 changed files with 6 additions and 15 deletions

View File

@ -4,20 +4,18 @@ namespace YooAsset.Editor
{
public static class AssetBundleSimulateBuilder
{
private static string _manifestFilePath = string.Empty;
/// <summary>
/// 模拟构建
/// </summary>
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;
}
}
/// <summary>
/// 获取构建的补丁清单路径
/// </summary>
public static string GetPatchManifestPath()
{
return _manifestFilePath;
return null;
}
}
}
}