1
This commit is contained in:
29
Src/Unity/Scripts/Assets/StreamingAssetsHelper.cs
Normal file
29
Src/Unity/Scripts/Assets/StreamingAssetsHelper.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
/// <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);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user