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