Update editor code
parent
a71921cdd1
commit
6549fbb552
|
@ -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;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取构建的补丁清单路径
|
||||
/// </summary>
|
||||
public static string GetPatchManifestPath()
|
||||
{
|
||||
return _manifestFilePath;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue