mirror of
https://github.com/tuyoogame/YooAsset.git
synced 2026-05-28 11:38:47 +00:00
style : The hash utility class is exposed
This commit is contained in:
@@ -496,14 +496,6 @@ namespace YooAsset.Editor
|
|||||||
return fileInfo.Length;
|
return fileInfo.Length;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取文件的哈希值
|
|
||||||
/// </summary>
|
|
||||||
public static string GetFileCRC32(string filePath)
|
|
||||||
{
|
|
||||||
return HashUtility.FileCRC32(filePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 读取文件的所有文本内容
|
/// 读取文件的所有文本内容
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -413,6 +413,9 @@ namespace YooAsset
|
|||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取指定版本的缓存信息
|
||||||
|
/// </summary>
|
||||||
public GetAllCacheFileInfosOperation GetAllCacheFileInfosAsync(string packageVersion)
|
public GetAllCacheFileInfosOperation GetAllCacheFileInfosAsync(string packageVersion)
|
||||||
{
|
{
|
||||||
DebugCheckInitialize();
|
DebugCheckInitialize();
|
||||||
|
|||||||
@@ -191,7 +191,7 @@ namespace YooAsset
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 哈希工具类
|
/// 哈希工具类
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static class HashUtility
|
public static class HashUtility
|
||||||
{
|
{
|
||||||
private static string ToString(byte[] hashBytes)
|
private static string ToString(byte[] hashBytes)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ public sealed class StreamingAssetsHelper
|
|||||||
{
|
{
|
||||||
if (GameQueryServices.CompareFileCRC)
|
if (GameQueryServices.CompareFileCRC)
|
||||||
{
|
{
|
||||||
string crc32 = YooAsset.Editor.EditorTools.GetFileCRC32(filePath);
|
string crc32 = YooAsset.HashUtility.FileCRC32(filePath);
|
||||||
return crc32 == fileCRC;
|
return crc32 == fileCRC;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -146,7 +146,7 @@ internal class PreprocessBuild : UnityEditor.Build.IPreprocessBuildWithReport
|
|||||||
|
|
||||||
BuildinFileManifest.Element element = new BuildinFileManifest.Element();
|
BuildinFileManifest.Element element = new BuildinFileManifest.Element();
|
||||||
element.PackageName = fileInfo.Directory.Name;
|
element.PackageName = fileInfo.Directory.Name;
|
||||||
element.FileCRC32 = YooAsset.Editor.EditorTools.GetFileCRC32(fileInfo.FullName);
|
element.FileCRC32 = YooAsset.HashUtility.FileCRC32(fileInfo.FullName);
|
||||||
element.FileName = fileInfo.Name;
|
element.FileName = fileInfo.Name;
|
||||||
manifest.BuildinFiles.Add(element);
|
manifest.BuildinFiles.Add(element);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user