Update AssetBundleBuilder

pull/35/head
hevinci 2022-08-05 14:40:27 +08:00
parent 188957ee91
commit d6e3da322b
1 changed files with 13 additions and 9 deletions

View File

@ -14,6 +14,8 @@ namespace YooAsset.Editor
var buildParameters = context.GetContextObject<BuildParametersContext>();
buildParameters.BeginWatch();
var buildMode = buildParameters.Parameters.BuildMode;
// 检测构建平台是否合法
if (buildParameters.Parameters.BuildTarget == BuildTarget.NoTarget)
throw new Exception("请选择目标平台");
@ -26,6 +28,8 @@ namespace YooAsset.Editor
if (string.IsNullOrEmpty(buildParameters.PipelineOutputDirectory))
throw new Exception("输出目录不能为空");
if (buildMode != EBuildMode.SimulateBuild)
{
// 检测当前是否正在构建资源包
if (BuildPipeline.isBuildingPlayer)
throw new Exception("当前正在构建资源包,请结束后再试");
@ -36,9 +40,9 @@ namespace YooAsset.Editor
// 保存改动的资源
AssetDatabase.SaveAssets();
}
// 增量更新时候的必要检测
var buildMode = buildParameters.Parameters.BuildMode;
if (buildMode == EBuildMode.IncrementalBuild)
{
// 检测历史版本是否存在