Skip to content

Commit ff5eeb1

Browse files
author
Jiang Yin
committed
统一压缩接口名称
1 parent f2ea2c8 commit ff5eeb1

24 files changed

+341
-341
lines changed

Libraries/GameFramework.dll

512 Bytes
Binary file not shown.

Libraries/GameFramework.xml

Lines changed: 190 additions & 190 deletions
Large diffs are not rendered by default.

Scripts/Editor/Inspector/BaseComponentInspector.cs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ internal sealed class BaseComponentInspector : GameFrameworkInspector
2424
private SerializedProperty m_EditorLanguage = null;
2525
private SerializedProperty m_VersionHelperTypeName = null;
2626
private SerializedProperty m_LogHelperTypeName = null;
27-
private SerializedProperty m_ZipHelperTypeName = null;
27+
private SerializedProperty m_CompressionHelperTypeName = null;
2828
private SerializedProperty m_JsonHelperTypeName = null;
2929
private SerializedProperty m_FrameRate = null;
3030
private SerializedProperty m_GameSpeed = null;
@@ -35,8 +35,8 @@ internal sealed class BaseComponentInspector : GameFrameworkInspector
3535
private int m_VersionHelperTypeNameIndex = 0;
3636
private string[] m_LogHelperTypeNames = null;
3737
private int m_LogHelperTypeNameIndex = 0;
38-
private string[] m_ZipHelperTypeNames = null;
39-
private int m_ZipHelperTypeNameIndex = 0;
38+
private string[] m_CompressionHelperTypeNames = null;
39+
private int m_CompressionHelperTypeNameIndex = 0;
4040
private string[] m_JsonHelperTypeNames = null;
4141
private int m_JsonHelperTypeNameIndex = 0;
4242

@@ -76,11 +76,11 @@ public override void OnInspectorGUI()
7676
m_LogHelperTypeName.stringValue = logHelperSelectedIndex <= 0 ? null : m_LogHelperTypeNames[logHelperSelectedIndex];
7777
}
7878

79-
int zipHelperSelectedIndex = EditorGUILayout.Popup("Zip Helper", m_ZipHelperTypeNameIndex, m_ZipHelperTypeNames);
80-
if (zipHelperSelectedIndex != m_ZipHelperTypeNameIndex)
79+
int compressionHelperSelectedIndex = EditorGUILayout.Popup("Compression Helper", m_CompressionHelperTypeNameIndex, m_CompressionHelperTypeNames);
80+
if (compressionHelperSelectedIndex != m_CompressionHelperTypeNameIndex)
8181
{
82-
m_ZipHelperTypeNameIndex = zipHelperSelectedIndex;
83-
m_ZipHelperTypeName.stringValue = zipHelperSelectedIndex <= 0 ? null : m_ZipHelperTypeNames[zipHelperSelectedIndex];
82+
m_CompressionHelperTypeNameIndex = compressionHelperSelectedIndex;
83+
m_CompressionHelperTypeName.stringValue = compressionHelperSelectedIndex <= 0 ? null : m_CompressionHelperTypeNames[compressionHelperSelectedIndex];
8484
}
8585

8686
int jsonHelperSelectedIndex = EditorGUILayout.Popup("JSON Helper", m_JsonHelperTypeNameIndex, m_JsonHelperTypeNames);
@@ -172,7 +172,7 @@ private void OnEnable()
172172
m_EditorLanguage = serializedObject.FindProperty("m_EditorLanguage");
173173
m_VersionHelperTypeName = serializedObject.FindProperty("m_VersionHelperTypeName");
174174
m_LogHelperTypeName = serializedObject.FindProperty("m_LogHelperTypeName");
175-
m_ZipHelperTypeName = serializedObject.FindProperty("m_ZipHelperTypeName");
175+
m_CompressionHelperTypeName = serializedObject.FindProperty("m_CompressionHelperTypeName");
176176
m_JsonHelperTypeName = serializedObject.FindProperty("m_JsonHelperTypeName");
177177
m_FrameRate = serializedObject.FindProperty("m_FrameRate");
178178
m_GameSpeed = serializedObject.FindProperty("m_GameSpeed");
@@ -220,21 +220,21 @@ private void RefreshTypeNames()
220220
}
221221
}
222222

223-
List<string> zipHelperTypeNames = new List<string>
223+
List<string> compressionHelperTypeNames = new List<string>
224224
{
225225
NoneOptionName
226226
};
227227

228-
zipHelperTypeNames.AddRange(Type.GetTypeNames(typeof(Utility.Zip.IZipHelper)));
229-
m_ZipHelperTypeNames = zipHelperTypeNames.ToArray();
230-
m_ZipHelperTypeNameIndex = 0;
231-
if (!string.IsNullOrEmpty(m_ZipHelperTypeName.stringValue))
228+
compressionHelperTypeNames.AddRange(Type.GetTypeNames(typeof(Utility.Compression.ICompressionHelper)));
229+
m_CompressionHelperTypeNames = compressionHelperTypeNames.ToArray();
230+
m_CompressionHelperTypeNameIndex = 0;
231+
if (!string.IsNullOrEmpty(m_CompressionHelperTypeName.stringValue))
232232
{
233-
m_ZipHelperTypeNameIndex = zipHelperTypeNames.IndexOf(m_ZipHelperTypeName.stringValue);
234-
if (m_ZipHelperTypeNameIndex <= 0)
233+
m_CompressionHelperTypeNameIndex = compressionHelperTypeNames.IndexOf(m_CompressionHelperTypeName.stringValue);
234+
if (m_CompressionHelperTypeNameIndex <= 0)
235235
{
236-
m_ZipHelperTypeNameIndex = 0;
237-
m_ZipHelperTypeName.stringValue = null;
236+
m_CompressionHelperTypeNameIndex = 0;
237+
m_CompressionHelperTypeName.stringValue = null;
238238
}
239239
}
240240

Scripts/Editor/ResourceBuilder/IBuildEventHandler.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ bool ContinueOnFailure
3434
/// <param name="applicableGameVersion">适用游戏版本。</param>
3535
/// <param name="internalResourceVersion">内部资源版本。</param>
3636
/// <param name="buildAssetBundleOptions">生成选项。</param>
37-
/// <param name="zip">是否压缩。</param>
37+
/// <param name="compressSelected">是否压缩。</param>
3838
/// <param name="outputDirectory">生成目录。</param>
3939
/// <param name="workingPath">生成时的工作路径。</param>
4040
/// <param name="outputPackageSelected">是否生成单机模式所需的文件。</param>
@@ -45,7 +45,7 @@ bool ContinueOnFailure
4545
/// <param name="outputPackedPath">为可更新模式生成的本地文件存放于此路径。若游戏是网络游戏,生成结束后将此目录中对应平台的文件拷贝至 StreamingAssets 后打包 App 即可。</param>
4646
/// <param name="buildReportPath">生成报告路径。</param>
4747
void OnPreprocessAllPlatforms(string productName, string companyName, string gameIdentifier,
48-
string gameFrameworkVersion, string unityVersion, string applicableGameVersion, int internalResourceVersion, BuildAssetBundleOptions buildAssetBundleOptions, bool zip,
48+
string gameFrameworkVersion, string unityVersion, string applicableGameVersion, int internalResourceVersion, BuildAssetBundleOptions buildAssetBundleOptions, bool compressSelected,
4949
string outputDirectory, string workingPath, bool outputPackageSelected, string outputPackagePath, bool outputFullSelected, string outputFullPath, bool outputPackedSelected, string outputPackedPath, string buildReportPath);
5050

5151
/// <summary>
@@ -82,9 +82,9 @@ void OnPreprocessAllPlatforms(string productName, string companyName, string gam
8282
/// <param name="versionListPath">可更新模式版本列表文件的路径。</param>
8383
/// <param name="versionListLength">可更新模式版本列表文件的长度。</param>
8484
/// <param name="versionListHashCode">可更新模式版本列表文件的校验值。</param>
85-
/// <param name="versionListZipLength">可更新模式版本列表文件压缩后的长度。</param>
86-
/// <param name="versionListZipHashCode">可更新模式版本列表文件压缩后的校验值。</param>
87-
void OnOutputUpdatableVersionListData(Platform platform, string versionListPath, int versionListLength, int versionListHashCode, int versionListZipLength, int versionListZipHashCode);
85+
/// <param name="versionListCompressedLength">可更新模式版本列表文件压缩后的长度。</param>
86+
/// <param name="versionListCompressedHashCode">可更新模式版本列表文件压缩后的校验值。</param>
87+
void OnOutputUpdatableVersionListData(Platform platform, string versionListPath, int versionListLength, int versionListHashCode, int versionListCompressedLength, int versionListCompressedHashCode);
8888

8989
/// <summary>
9090
/// 某个平台生成结束后的后处理事件。
@@ -111,7 +111,7 @@ void OnPreprocessAllPlatforms(string productName, string companyName, string gam
111111
/// <param name="applicableGameVersion">适用游戏版本。</param>
112112
/// <param name="internalResourceVersion">内部资源版本。</param>
113113
/// <param name="buildAssetBundleOptions">生成选项。</param>
114-
/// <param name="zip">是否压缩。</param>
114+
/// <param name="compressSelected">是否压缩。</param>
115115
/// <param name="outputDirectory">生成目录。</param>
116116
/// <param name="workingPath">生成时的工作路径。</param>
117117
/// <param name="outputPackageSelected">是否生成单机模式所需的文件。</param>
@@ -122,7 +122,7 @@ void OnPreprocessAllPlatforms(string productName, string companyName, string gam
122122
/// <param name="outputPackedPath">为可更新模式生成的本地文件存放于此路径。若游戏是网络游戏,生成结束后将此目录中对应平台的文件拷贝至 StreamingAssets 后打包 App 即可。</param>
123123
/// <param name="buildReportPath">生成报告路径。</param>
124124
void OnPostprocessAllPlatforms(string productName, string companyName, string gameIdentifier,
125-
string gameFrameworkVersion, string unityVersion, string applicableGameVersion, int internalResourceVersion, BuildAssetBundleOptions buildAssetBundleOptions, bool zip,
125+
string gameFrameworkVersion, string unityVersion, string applicableGameVersion, int internalResourceVersion, BuildAssetBundleOptions buildAssetBundleOptions, bool compressSelected,
126126
string outputDirectory, string workingPath, bool outputPackageSelected, string outputPackagePath, bool outputFullSelected, string outputFullPath, bool outputPackedSelected, string outputPackedPath, string buildReportPath);
127127
}
128128
}

Scripts/Editor/ResourceBuilder/ResourceBuilder.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ private void OnGUI()
152152
EditorGUILayout.EndHorizontal();
153153
EditorGUILayout.BeginVertical();
154154
{
155-
m_Controller.ZipSelected = EditorGUILayout.ToggleLeft("Zip All Resources", m_Controller.ZipSelected);
155+
m_Controller.CompressSelected = EditorGUILayout.ToggleLeft("Compress All Resources with Specified Compression", m_Controller.CompressSelected);
156156
}
157157
EditorGUILayout.EndVertical();
158158
}
@@ -343,21 +343,21 @@ private void BrowseOutputDirectory()
343343

344344
private void GetCompressMessage(out string message, out MessageType messageType)
345345
{
346-
if (m_Controller.ZipSelected)
346+
if (m_Controller.CompressSelected)
347347
{
348348
if (m_Controller.UncompressedAssetBundleSelected)
349349
{
350-
message = "Compresses AssetBundles with ZIP only. It uses more storage but it's faster when loading the AssetBundles.";
350+
message = "Compresses AssetBundles with specified compression only. It uses more storage but it's faster when loading the AssetBundles.";
351351
messageType = MessageType.Info;
352352
}
353353
else if (m_Controller.ChunkBasedCompressionSelected)
354354
{
355-
message = "Compresses AssetBundles with both chunk-based compression and ZIP. Recommended when you use 'AssetBundle.LoadFromFile'.";
355+
message = "Compresses AssetBundles with both chunk-based compression and specified compression. Recommended when you use 'AssetBundle.LoadFromFile'.";
356356
messageType = MessageType.Info;
357357
}
358358
else
359359
{
360-
message = "Compresses AssetBundles with both LZMA and ZIP. Not recommended.";
360+
message = "Compresses AssetBundles with both LZMA and specified compression. Not recommended.";
361361
messageType = MessageType.Warning;
362362
}
363363
}

Scripts/Editor/ResourceBuilder/ResourceBuilderController.BuildReport.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ private sealed class BuildReport
3131
private string m_ApplicableGameVersion = null;
3232
private int m_InternalResourceVersion = 0;
3333
private Platform m_Platforms = Platform.Undefined;
34-
private bool m_ZipSelected = false;
34+
private bool m_CompressSelected = false;
3535
private int m_BuildAssetBundleOptions = 0;
3636
private StringBuilder m_LogBuilder = null;
3737
private SortedDictionary<string, ResourceData> m_ResourceDatas = null;
3838

3939
public void Initialize(string buildReportPath, string productName, string companyName, string gameIdentifier, string gameFrameworkVersion, string unityVersion, string applicableGameVersion, int internalResourceVersion,
40-
Platform platforms, bool zipSelected, int buildAssetBundleOptions, SortedDictionary<string, ResourceData> resourceDatas)
40+
Platform platforms, bool compressSelected, int buildAssetBundleOptions, SortedDictionary<string, ResourceData> resourceDatas)
4141
{
4242
if (string.IsNullOrEmpty(buildReportPath))
4343
{
@@ -54,7 +54,7 @@ public void Initialize(string buildReportPath, string productName, string compan
5454
m_ApplicableGameVersion = applicableGameVersion;
5555
m_InternalResourceVersion = internalResourceVersion;
5656
m_Platforms = platforms;
57-
m_ZipSelected = zipSelected;
57+
m_CompressSelected = compressSelected;
5858
m_BuildAssetBundleOptions = buildAssetBundleOptions;
5959
m_LogBuilder = new StringBuilder();
6060
m_ResourceDatas = resourceDatas;
@@ -121,8 +121,8 @@ public void SaveReport()
121121
xmlElement = xmlDocument.CreateElement("Platforms");
122122
xmlElement.InnerText = m_Platforms.ToString();
123123
xmlSummary.AppendChild(xmlElement);
124-
xmlElement = xmlDocument.CreateElement("ZipSelected");
125-
xmlElement.InnerText = m_ZipSelected.ToString();
124+
xmlElement = xmlDocument.CreateElement("CompressSelected");
125+
xmlElement.InnerText = m_CompressSelected.ToString();
126126
xmlSummary.AppendChild(xmlElement);
127127
xmlElement = xmlDocument.CreateElement("BuildAssetBundleOptions");
128128
xmlElement.InnerText = m_BuildAssetBundleOptions.ToString();
@@ -225,11 +225,11 @@ public void SaveReport()
225225
xmlAttribute = xmlDocument.CreateAttribute("HashCode");
226226
xmlAttribute.Value = resourceCode.HashCode.ToString();
227227
xmlCode.Attributes.SetNamedItem(xmlAttribute);
228-
xmlAttribute = xmlDocument.CreateAttribute("ZipLength");
229-
xmlAttribute.Value = resourceCode.ZipLength.ToString();
228+
xmlAttribute = xmlDocument.CreateAttribute("CompressedLength");
229+
xmlAttribute.Value = resourceCode.CompressedLength.ToString();
230230
xmlCode.Attributes.SetNamedItem(xmlAttribute);
231-
xmlAttribute = xmlDocument.CreateAttribute("ZipHashCode");
232-
xmlAttribute.Value = resourceCode.ZipHashCode.ToString();
231+
xmlAttribute = xmlDocument.CreateAttribute("CompressedHashCode");
232+
xmlAttribute.Value = resourceCode.CompressedHashCode.ToString();
233233
xmlCode.Attributes.SetNamedItem(xmlAttribute);
234234
xmlCodes.AppendChild(xmlCode);
235235
}

Scripts/Editor/ResourceBuilder/ResourceBuilderController.ResourceCode.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@ private sealed class ResourceCode
1414
private readonly Platform m_Platform;
1515
private readonly int m_Length;
1616
private readonly int m_HashCode;
17-
private readonly int m_ZipLength;
18-
private readonly int m_ZipHashCode;
17+
private readonly int m_CompressedLength;
18+
private readonly int m_CompressedHashCode;
1919

20-
public ResourceCode(Platform platform, int length, int hashCode, int zipLength, int zipHashCode)
20+
public ResourceCode(Platform platform, int length, int hashCode, int compressedLength, int compressedHashCode)
2121
{
2222
m_Platform = platform;
2323
m_Length = length;
2424
m_HashCode = hashCode;
25-
m_ZipLength = zipLength;
26-
m_ZipHashCode = zipHashCode;
25+
m_CompressedLength = compressedLength;
26+
m_CompressedHashCode = compressedHashCode;
2727
}
2828

2929
public Platform Platform
@@ -50,19 +50,19 @@ public int HashCode
5050
}
5151
}
5252

53-
public int ZipLength
53+
public int CompressedLength
5454
{
5555
get
5656
{
57-
return m_ZipLength;
57+
return m_CompressedLength;
5858
}
5959
}
6060

61-
public int ZipHashCode
61+
public int CompressedHashCode
6262
{
6363
get
6464
{
65-
return m_ZipHashCode;
65+
return m_CompressedHashCode;
6666
}
6767
}
6868
}

Scripts/Editor/ResourceBuilder/ResourceBuilderController.ResourceData.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,9 @@ public ResourceCode[] GetCodes()
158158
return m_Codes.ToArray();
159159
}
160160

161-
public void AddCode(Platform platform, int length, int hashCode, int zipLength, int zipHashCode)
161+
public void AddCode(Platform platform, int length, int hashCode, int compressedLength, int compressedHashCode)
162162
{
163-
m_Codes.Add(new ResourceCode(platform, length, hashCode, zipLength, zipHashCode));
163+
m_Codes.Add(new ResourceCode(platform, length, hashCode, compressedLength, compressedHashCode));
164164
}
165165
}
166166
}

Scripts/Editor/ResourceBuilder/ResourceBuilderController.VersionListData.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ public sealed partial class ResourceBuilderController
1111
{
1212
private sealed class VersionListData
1313
{
14-
public VersionListData(string path, int length, int hashCode, int zipLength, int zipHashCode)
14+
public VersionListData(string path, int length, int hashCode, int compressedLength, int compressedHashCode)
1515
{
1616
Path = path;
1717
Length = length;
1818
HashCode = hashCode;
19-
ZipLength = zipLength;
20-
ZipHashCode = zipHashCode;
19+
CompressedLength = compressedLength;
20+
CompressedHashCode = compressedHashCode;
2121
}
2222

2323
public string Path
@@ -38,13 +38,13 @@ public int HashCode
3838
private set;
3939
}
4040

41-
public int ZipLength
41+
public int CompressedLength
4242
{
4343
get;
4444
private set;
4545
}
4646

47-
public int ZipHashCode
47+
public int CompressedHashCode
4848
{
4949
get;
5050
private set;

0 commit comments

Comments
 (0)