update editor

1. 编辑器界面支持本地化配置。
2. 资源构建过程中的异常输出增加错误码提示。
3. 修复了资源构建界面乱码问题。
4. 修复了自动收集着色器对依赖资源无效的问题。
This commit is contained in:
hevinci
2023-10-13 12:06:20 +08:00
parent db889366ac
commit 0c70f27560
66 changed files with 623 additions and 268 deletions

View File

@@ -5,7 +5,6 @@ using System.Collections.Generic;
namespace YooAsset.Editor
{
[TaskAttribute("资源构建内容打包")]
public class TaskBuilding_RFBP : IBuildTask
{
void IBuildTask.Run(BuildContext context)

View File

@@ -6,7 +6,6 @@ using UnityEngine;
namespace YooAsset.Editor
{
[TaskAttribute("拷贝内置文件")]
public class TaskCopyBuildinFiles_RFBP : TaskCopyBuildinFiles, IBuildTask
{
void IBuildTask.Run(BuildContext context)

View File

@@ -5,7 +5,6 @@ using System.Collections.Generic;
namespace YooAsset.Editor
{
[TaskAttribute("创建清单文件")]
public class TaskCreateManifest_RFBP : TaskCreateManifest, IBuildTask
{
void IBuildTask.Run(BuildContext context)

View File

@@ -3,7 +3,6 @@ using System.Collections.Generic;
namespace YooAsset.Editor
{
[TaskAttribute("制作包裹")]
public class TaskCreatePackage_RFBP : IBuildTask
{
void IBuildTask.Run(BuildContext context)
@@ -13,19 +12,17 @@ namespace YooAsset.Editor
var buildMode = buildParameters.Parameters.BuildMode;
if (buildMode != EBuildMode.SimulateBuild)
{
CopyPackageFiles(buildParameters, buildMapContext);
CreatePackageCatalog(buildParameters, buildMapContext);
}
}
/// <summary>
/// 拷贝补丁文件到补丁包目录
/// </summary>
private void CopyPackageFiles(BuildParametersContext buildParametersContext, BuildMapContext buildMapContext)
private void CreatePackageCatalog(BuildParametersContext buildParametersContext, BuildMapContext buildMapContext)
{
var buildParameters = buildParametersContext.Parameters;
string pipelineOutputDirectory = buildParametersContext.GetPipelineOutputDirectory();
string packageOutputDirectory = buildParametersContext.GetPackageOutputDirectory();
BuildLogger.Log($"开始拷贝补丁文件到补丁包目录:{packageOutputDirectory}");
BuildLogger.Log($"Start making patch package: {packageOutputDirectory}");
// 拷贝所有补丁文件
int progressValue = 0;
@@ -33,7 +30,7 @@ namespace YooAsset.Editor
foreach (var bundleInfo in buildMapContext.Collection)
{
EditorTools.CopyFile(bundleInfo.PackageSourceFilePath, bundleInfo.PackageDestFilePath, true);
EditorTools.DisplayProgressBar("拷贝补丁文件", ++progressValue, fileTotalCount);
EditorTools.DisplayProgressBar("Copy patch file", ++progressValue, fileTotalCount);
}
EditorTools.ClearProgressBar();
}

View File

@@ -6,7 +6,6 @@ using UnityEditor;
namespace YooAsset.Editor
{
[TaskAttribute("创建构建报告文件")]
public class TaskCreateReport_RFBP : TaskCreateReport, IBuildTask
{
void IBuildTask.Run(BuildContext context)

View File

@@ -7,7 +7,6 @@ using UnityEditor;
namespace YooAsset.Editor
{
[TaskAttribute("获取资源构建内容")]
public class TaskGetBuildMap_RFBP : TaskGetBuildMap, IBuildTask
{
void IBuildTask.Run(BuildContext context)
@@ -29,7 +28,10 @@ namespace YooAsset.Editor
foreach (var bundleInfo in buildMapContext.Collection)
{
if (bundleInfo.MainAssets.Count != 1)
throw new Exception($"The bundle does not support multiple raw asset : {bundleInfo.BundleName}");
{
string message = BuildLogger.GetErrorMessage(ErrorCode.NotSupportMultipleRawAsset, $"The bundle does not support multiple raw asset : {bundleInfo.BundleName}");
throw new Exception(message);
}
}
}
}

View File

@@ -6,7 +6,6 @@ using UnityEditor;
namespace YooAsset.Editor
{
[TaskAttribute("资源构建准备工作")]
public class TaskPrepare_RFBP : IBuildTask
{
void IBuildTask.Run(BuildContext context)
@@ -19,9 +18,15 @@ namespace YooAsset.Editor
// 检测不被支持的构建模式
if (buildParameters.BuildMode == EBuildMode.DryRunBuild)
throw new Exception($"{nameof(EBuildPipeline.ScriptableBuildPipeline)} not support {nameof(EBuildMode.DryRunBuild)} build mode !");
{
string message = BuildLogger.GetErrorMessage(ErrorCode.BuildPipelineNotSupportBuildMode, $"{nameof(EBuildPipeline.RawFileBuildPipeline)} not support {nameof(EBuildMode.DryRunBuild)} build mode !");
throw new Exception(message);
}
if (buildParameters.BuildMode == EBuildMode.IncrementalBuild)
throw new Exception($"{nameof(EBuildPipeline.ScriptableBuildPipeline)} not support {nameof(EBuildMode.IncrementalBuild)} build mode !");
{
string message = BuildLogger.GetErrorMessage(ErrorCode.BuildPipelineNotSupportBuildMode, $"{nameof(EBuildPipeline.RawFileBuildPipeline)} not support {nameof(EBuildMode.IncrementalBuild)} build mode !");
throw new Exception(message);
}
}
}
}

View File

@@ -6,7 +6,6 @@ using UnityEditor;
namespace YooAsset.Editor
{
[TaskAttribute("更新资源包信息")]
public class TaskUpdateBundleInfo_RFBP : TaskUpdateBundleInfo, IBuildTask
{
void IBuildTask.Run(BuildContext context)

View File

@@ -22,14 +22,14 @@ namespace YooAsset.Editor
{
List<IBuildTask> pipeline = new List<IBuildTask>
{
new TaskPrepare_RFBP(), //前期准备工作
new TaskGetBuildMap_RFBP(), //获取构建列表
new TaskBuilding_RFBP(), //开始执行构建
new TaskUpdateBundleInfo_RFBP(), //更新资源包信息
new TaskCreateManifest_RFBP(), //创建清单文件
new TaskCreateReport_RFBP(), //创建报告文件
new TaskCreatePackage_RFBP(), //制作包裹
new TaskCopyBuildinFiles_RFBP(), //拷贝内置文件
new TaskPrepare_RFBP(),
new TaskGetBuildMap_RFBP(),
new TaskBuilding_RFBP(),
new TaskUpdateBundleInfo_RFBP(),
new TaskCreateManifest_RFBP(),
new TaskCreateReport_RFBP(),
new TaskCreatePackage_RFBP(),
new TaskCopyBuildinFiles_RFBP(),
};
return pipeline;
}