Skip to content

Commit 8e170cc

Browse files
author
Jiang Yin
committed
调整资源包构建工具
1 parent 60380e7 commit 8e170cc

File tree

9 files changed

+364
-286
lines changed

9 files changed

+364
-286
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
//------------------------------------------------------------
2+
// Game Framework
3+
// Copyright © 2013-2021 Jiang Yin. All rights reserved.
4+
// Homepage: https://gameframework.cn/
5+
// Feedback: mailto:[email protected]
6+
//------------------------------------------------------------
7+
8+
namespace UnityGameFramework.Editor.ResourceTools
9+
{
10+
/// <summary>
11+
/// 对 AssetBundle 应用的压缩算法类型。
12+
/// </summary>
13+
public enum AssetBundleCompressionType : byte
14+
{
15+
/// <summary>
16+
/// 不使用压缩算法。
17+
/// </summary>
18+
Uncompressed = 0,
19+
20+
/// <summary>
21+
/// 使用 LZ4 压缩算法。
22+
/// </summary>
23+
LZ4,
24+
25+
/// <summary>
26+
/// 使用 LZMA 压缩算法。
27+
/// </summary>
28+
LZMA
29+
}
30+
}

Scripts/Editor/ResourceBuilder/AssetBundleCompressionType.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Scripts/Editor/ResourceBuilder/IBuildEventHandler.cs

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,14 @@ bool ContinueOnFailure
3333
/// <param name="unityVersion">Unity 版本。</param>
3434
/// <param name="applicableGameVersion">适用游戏版本。</param>
3535
/// <param name="internalResourceVersion">内部资源版本。</param>
36-
/// <param name="buildAssetBundleOptions">生成选项。</param>
37-
/// <param name="compressSelected">是否压缩。</param>
36+
/// <param name="platforms">生成的目标平台。</param>
37+
/// <param name="assetBundleCompression">AssetBundle 压缩类型。</param>
38+
/// <param name="compressionHelperTypeName">压缩解压缩辅助器类型名称。</param>
39+
/// <param name="additionalCompressionSelected">是否进行再压缩以降低传输开销。</param>
40+
/// <param name="forceRebuildAssetBundleSelected">是否强制重新构建 AssetBundle。</param>
41+
/// <param name="buildEventHandlerTypeName">生成资源事件处理函数名称。</param>
3842
/// <param name="outputDirectory">生成目录。</param>
43+
/// <param name="buildAssetBundleOptions">AssetBundle 生成选项。</param>
3944
/// <param name="workingPath">生成时的工作路径。</param>
4045
/// <param name="outputPackageSelected">是否生成单机模式所需的文件。</param>
4146
/// <param name="outputPackagePath">为单机模式生成的文件存放于此路径。若游戏是单机游戏,生成结束后将此目录中对应平台的文件拷贝至 StreamingAssets 后打包 App 即可。</param>
@@ -44,9 +49,9 @@ bool ContinueOnFailure
4449
/// <param name="outputPackedSelected">是否生成可更新模式所需的本地文件。</param>
4550
/// <param name="outputPackedPath">为可更新模式生成的本地文件存放于此路径。若游戏是网络游戏,生成结束后将此目录中对应平台的文件拷贝至 StreamingAssets 后打包 App 即可。</param>
4651
/// <param name="buildReportPath">生成报告路径。</param>
47-
void OnPreprocessAllPlatforms(string productName, string companyName, string gameIdentifier,
48-
string gameFrameworkVersion, string unityVersion, string applicableGameVersion, int internalResourceVersion, BuildAssetBundleOptions buildAssetBundleOptions, bool compressSelected,
49-
string outputDirectory, string workingPath, bool outputPackageSelected, string outputPackagePath, bool outputFullSelected, string outputFullPath, bool outputPackedSelected, string outputPackedPath, string buildReportPath);
52+
void OnPreprocessAllPlatforms(string productName, string companyName, string gameIdentifier, string gameFrameworkVersion, string unityVersion, string applicableGameVersion, int internalResourceVersion,
53+
Platform platforms, AssetBundleCompressionType assetBundleCompression, string compressionHelperTypeName, bool additionalCompressionSelected, bool forceRebuildAssetBundleSelected, string buildEventHandlerTypeName, string outputDirectory, BuildAssetBundleOptions buildAssetBundleOptions,
54+
string workingPath, bool outputPackageSelected, string outputPackagePath, bool outputFullSelected, string outputFullPath, bool outputPackedSelected, string outputPackedPath, string buildReportPath);
5055

5156
/// <summary>
5257
/// 某个平台生成开始前的预处理事件。
@@ -110,9 +115,14 @@ void OnPreprocessAllPlatforms(string productName, string companyName, string gam
110115
/// <param name="unityVersion">Unity 版本。</param>
111116
/// <param name="applicableGameVersion">适用游戏版本。</param>
112117
/// <param name="internalResourceVersion">内部资源版本。</param>
113-
/// <param name="buildAssetBundleOptions">生成选项。</param>
114-
/// <param name="compressSelected">是否压缩。</param>
118+
/// <param name="platforms">生成的目标平台。</param>
119+
/// <param name="assetBundleCompression">AssetBundle 压缩类型。</param>
120+
/// <param name="compressionHelperTypeName">压缩解压缩辅助器类型名称。</param>
121+
/// <param name="additionalCompressionSelected">是否进行再压缩以降低传输开销。</param>
122+
/// <param name="forceRebuildAssetBundleSelected">是否强制重新构建 AssetBundle。</param>
123+
/// <param name="buildEventHandlerTypeName">生成资源事件处理函数名称。</param>
115124
/// <param name="outputDirectory">生成目录。</param>
125+
/// <param name="buildAssetBundleOptions">AssetBundle 生成选项。</param>
116126
/// <param name="workingPath">生成时的工作路径。</param>
117127
/// <param name="outputPackageSelected">是否生成单机模式所需的文件。</param>
118128
/// <param name="outputPackagePath">为单机模式生成的文件存放于此路径。若游戏是单机游戏,生成结束后将此目录中对应平台的文件拷贝至 StreamingAssets 后打包 App 即可。</param>
@@ -121,8 +131,8 @@ void OnPreprocessAllPlatforms(string productName, string companyName, string gam
121131
/// <param name="outputPackedSelected">是否生成可更新模式所需的本地文件。</param>
122132
/// <param name="outputPackedPath">为可更新模式生成的本地文件存放于此路径。若游戏是网络游戏,生成结束后将此目录中对应平台的文件拷贝至 StreamingAssets 后打包 App 即可。</param>
123133
/// <param name="buildReportPath">生成报告路径。</param>
124-
void OnPostprocessAllPlatforms(string productName, string companyName, string gameIdentifier,
125-
string gameFrameworkVersion, string unityVersion, string applicableGameVersion, int internalResourceVersion, BuildAssetBundleOptions buildAssetBundleOptions, bool compressSelected,
126-
string outputDirectory, string workingPath, bool outputPackageSelected, string outputPackagePath, bool outputFullSelected, string outputFullPath, bool outputPackedSelected, string outputPackedPath, string buildReportPath);
134+
void OnPostprocessAllPlatforms(string productName, string companyName, string gameIdentifier, string gameFrameworkVersion, string unityVersion, string applicableGameVersion, int internalResourceVersion,
135+
Platform platforms, AssetBundleCompressionType assetBundleCompression, string compressionHelperTypeName, bool additionalCompressionSelected, bool forceRebuildAssetBundleSelected, string buildEventHandlerTypeName, string outputDirectory, BuildAssetBundleOptions buildAssetBundleOptions,
136+
string workingPath, bool outputPackageSelected, string outputPackagePath, bool outputFullSelected, string outputFullPath, bool outputPackedSelected, string outputPackedPath, string buildReportPath);
127137
}
128138
}

Scripts/Editor/ResourceBuilder/Platform.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
namespace UnityGameFramework.Editor.ResourceTools
1111
{
1212
[Flags]
13-
public enum Platform : byte
13+
public enum Platform : int
1414
{
1515
Undefined = 0,
1616

0 commit comments

Comments
 (0)