mirror of https://github.com/tuyoogame/YooAsset
parent
47962424eb
commit
0e29e9823d
|
@ -496,6 +496,14 @@ namespace YooAsset.Editor
|
|||
return fileInfo.Length;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取文件的哈希值
|
||||
/// </summary>
|
||||
public static string GetFileCRC32(string filePath)
|
||||
{
|
||||
return HashUtility.FileCRC32(filePath);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 读取文件的所有文本内容
|
||||
/// </summary>
|
||||
|
|
|
@ -75,7 +75,7 @@ namespace YooAsset
|
|||
{
|
||||
if (_deliveryQueryServices == null)
|
||||
return false;
|
||||
return _deliveryQueryServices.Query(PackageName, packageBundle.FileName);
|
||||
return _deliveryQueryServices.Query(PackageName, packageBundle.FileName, packageBundle.FileCRC);
|
||||
}
|
||||
private bool IsCachedPackageBundle(PackageBundle packageBundle)
|
||||
{
|
||||
|
@ -83,7 +83,7 @@ namespace YooAsset
|
|||
}
|
||||
private bool IsBuildinPackageBundle(PackageBundle packageBundle)
|
||||
{
|
||||
return _buildinQueryServices.Query(PackageName, packageBundle.FileName);
|
||||
return _buildinQueryServices.Query(PackageName, packageBundle.FileName, packageBundle.FileCRC);
|
||||
}
|
||||
|
||||
#region IPlayMode接口
|
||||
|
|
|
@ -67,7 +67,7 @@ namespace YooAsset
|
|||
// 查询相关
|
||||
private bool IsBuildinPackageBundle(PackageBundle packageBundle)
|
||||
{
|
||||
return _buildinQueryServices.Query(PackageName, packageBundle.FileName);
|
||||
return _buildinQueryServices.Query(PackageName, packageBundle.FileName, packageBundle.FileCRC);
|
||||
}
|
||||
|
||||
#region IPlayMode接口
|
||||
|
|
|
@ -6,6 +6,10 @@ namespace YooAsset
|
|||
/// <summary>
|
||||
/// 查询是否为应用程序内置的资源文件
|
||||
/// </summary>
|
||||
bool Query(string packageName, string fileName);
|
||||
/// <param name="packageName">包裹名称</param>
|
||||
/// <param name="fileName">文件名称(包含文件的后缀格式)</param>
|
||||
/// <param name="fileCRC">文件哈希值</param>
|
||||
/// <returns>返回查询结果</returns>
|
||||
bool Query(string packageName, string fileName, string fileCRC);
|
||||
}
|
||||
}
|
|
@ -6,11 +6,18 @@ namespace YooAsset
|
|||
/// <summary>
|
||||
/// 查询是否为开发者分发的资源文件
|
||||
/// </summary>
|
||||
bool Query(string packageName, string fileName);
|
||||
/// <param name="packageName">包裹名称</param>
|
||||
/// <param name="fileName">文件名称(包含文件的后缀格式)</param>
|
||||
/// <param name="fileCRC">文件哈希值</param>
|
||||
/// <returns>返回查询结果</returns>
|
||||
bool Query(string packageName, string fileName, string fileCRC);
|
||||
|
||||
/// <summary>
|
||||
/// 获取分发资源文件的路径
|
||||
/// </summary>
|
||||
/// <param name="packageName">包裹名称</param>
|
||||
/// <param name="fileName">文件名称(包含文件的后缀格式)</param>
|
||||
/// <returns>返回资源文件的路径</returns>
|
||||
string GetFilePath(string packageName, string fileName);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue