mirror of https://github.com/tuyoogame/YooAsset
Compare commits
No commits in common. "9dde15ac41d2ae9e3be7db422851fdd66968d930" and "dc33abde4617ea3fd8101174755f0abe704e1b75" have entirely different histories.
9dde15ac41
...
dc33abde46
|
@ -12,7 +12,7 @@ namespace YooAsset
|
|||
/// </summary>
|
||||
public static void WriteInfoToFile(string filePath, string dataFileCRC, long dataFileSize)
|
||||
{
|
||||
using (FileStream fs = new FileStream(filePath, FileMode.Create, FileAccess.Write, FileShare.Read))
|
||||
using (FileStream fs = new FileStream(filePath, FileMode.Create))
|
||||
{
|
||||
SharedBuffer.Clear();
|
||||
SharedBuffer.WriteUTF8(dataFileCRC);
|
||||
|
|
|
@ -15,19 +15,6 @@ public class GameQueryServices : IQueryServices
|
|||
}
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
/// <summary>
|
||||
/// StreamingAssets目录下资源查询帮助类
|
||||
/// </summary>
|
||||
public sealed class StreamingAssetsHelper
|
||||
{
|
||||
public static void Init() { }
|
||||
public static bool FileExists(string fileName)
|
||||
{
|
||||
return File.Exists(Path.Combine(Application.streamingAssetsPath, "BuildinFiles", fileName));
|
||||
}
|
||||
}
|
||||
#else
|
||||
/// <summary>
|
||||
/// StreamingAssets目录下资源查询帮助类
|
||||
/// </summary>
|
||||
|
@ -36,6 +23,13 @@ public sealed class StreamingAssetsHelper
|
|||
private static bool _isInit = false;
|
||||
private static readonly HashSet<string> _cacheData = new HashSet<string>();
|
||||
|
||||
#if UNITY_EDITOR
|
||||
public static void Init() { _isInit = true; }
|
||||
public static bool FileExists(string fileName)
|
||||
{
|
||||
return File.Exists(System.IO.Path.Combine(Application.streamingAssetsPath, "BuildinFiles", fileName));
|
||||
}
|
||||
#else
|
||||
/// <summary>
|
||||
/// 初始化
|
||||
/// </summary>
|
||||
|
@ -59,11 +53,11 @@ public sealed class StreamingAssetsHelper
|
|||
{
|
||||
if (_isInit == false)
|
||||
Init();
|
||||
|
||||
return _cacheData.Contains(fileName);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
internal class PreprocessBuild : UnityEditor.Build.IPreprocessBuildWithReport
|
||||
|
|
Loading…
Reference in New Issue