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

32 lines
832 B
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System.IO;
using System.Collections.Generic;
using UnityEngine;
using YooAsset;
/// <summary>
/// 资源文件查询服务类
/// </summary>
public class GameQueryServices : IBuildinQueryServices
{
public bool Query(string packageName, string fileName)
{
// 注意fileName包含文件格式
return StreamingAssetsHelper.FileExists(packageName, fileName);
}
public bool Query(string packageName, string fileName, string fileCRC)=>Query(packageName,fileName);
}
/// <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);
}
}