BITKit/Src/Unity/Scripts/Assets/StreamingAssetsHelper.cs

32 lines
808 B
C#
Raw Normal View History

2023-11-15 23:55:06 +08:00
using System.IO;
using System.Collections.Generic;
using UnityEngine;
using YooAsset;
/// <summary>
/// 资源文件查询服务类
/// </summary>
2024-11-03 16:38:17 +08:00
public class GameQueryServices
2023-11-15 23:55:06 +08:00
{
public bool Query(string packageName, string fileName)
{
// 注意fileName包含文件格式
return StreamingAssetsHelper.FileExists(packageName, fileName);
}
2024-03-31 23:31:00 +08:00
public bool Query(string packageName, string fileName, string fileCRC)=>Query(packageName,fileName);
2023-11-15 23:55:06 +08:00
}
/// <summary>
/// StreamingAssets目录下资源查询帮助类
/// </summary>
public sealed class StreamingAssetsHelper
{
public static void Init() { }
public static bool FileExists(string packageName, string fileName)
{
string filePath = Path.Combine(Application.streamingAssetsPath, packageName, fileName);
return File.Exists(filePath);
}
}