mirror of https://github.com/tuyoogame/YooAsset
Update AssetBundleBuilder
parent
188957ee91
commit
d6e3da322b
|
@ -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,19 +28,21 @@ namespace YooAsset.Editor
|
|||
if (string.IsNullOrEmpty(buildParameters.PipelineOutputDirectory))
|
||||
throw new Exception("输出目录不能为空");
|
||||
|
||||
// 检测当前是否正在构建资源包
|
||||
if (BuildPipeline.isBuildingPlayer)
|
||||
throw new Exception("当前正在构建资源包,请结束后再试");
|
||||
if (buildMode != EBuildMode.SimulateBuild)
|
||||
{
|
||||
// 检测当前是否正在构建资源包
|
||||
if (BuildPipeline.isBuildingPlayer)
|
||||
throw new Exception("当前正在构建资源包,请结束后再试");
|
||||
|
||||
// 检测是否有未保存场景
|
||||
if (EditorTools.HasDirtyScenes())
|
||||
throw new Exception("检测到未保存的场景文件");
|
||||
// 检测是否有未保存场景
|
||||
if (EditorTools.HasDirtyScenes())
|
||||
throw new Exception("检测到未保存的场景文件");
|
||||
|
||||
// 保存改动的资源
|
||||
AssetDatabase.SaveAssets();
|
||||
// 保存改动的资源
|
||||
AssetDatabase.SaveAssets();
|
||||
}
|
||||
|
||||
// 增量更新时候的必要检测
|
||||
var buildMode = buildParameters.Parameters.BuildMode;
|
||||
if (buildMode == EBuildMode.IncrementalBuild)
|
||||
{
|
||||
// 检测历史版本是否存在
|
||||
|
|
Loading…
Reference in New Issue