Compare commits

...

2 Commits
mlyDev ... main

Author SHA1 Message Date
hevinci dc33abde46 update asset system 2023-06-16 15:01:13 +08:00
hevinci aae7b08dd1 update space shooter 2023-06-16 14:10:33 +08:00
2 changed files with 9 additions and 1 deletions

View File

@ -246,7 +246,7 @@ namespace YooAsset
var result = CacheSystem.VerifyingRecordFile(MainBundleInfo.Bundle.PackageName, MainBundleInfo.Bundle.CacheGUID); var result = CacheSystem.VerifyingRecordFile(MainBundleInfo.Bundle.PackageName, MainBundleInfo.Bundle.CacheGUID);
if (result != EVerifyResult.Succeed) if (result != EVerifyResult.Succeed)
{ {
YooLogger.Error($"Found possibly corrupt file ! {MainBundleInfo.Bundle.CacheGUID}"); YooLogger.Error($"Found possibly corrupt file ! {MainBundleInfo.Bundle.CacheGUID} Verify result : {result}");
CacheSystem.DiscardFile(MainBundleInfo.Bundle.PackageName, MainBundleInfo.Bundle.CacheGUID); CacheSystem.DiscardFile(MainBundleInfo.Bundle.PackageName, MainBundleInfo.Bundle.CacheGUID);
} }
} }

View File

@ -23,6 +23,13 @@ public sealed class StreamingAssetsHelper
private static bool _isInit = false; private static bool _isInit = false;
private static readonly HashSet<string> _cacheData = new HashSet<string>(); 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>
/// 初始化 /// 初始化
/// </summary> /// </summary>
@ -49,6 +56,7 @@ public sealed class StreamingAssetsHelper
return _cacheData.Contains(fileName); return _cacheData.Contains(fileName);
} }
#endif
} }
#if UNITY_EDITOR #if UNITY_EDITOR