From 0744d684e881cc0ac2db06fddd00cdf7ed32ae9f Mon Sep 17 00:00:00 2001 From: hevinci Date: Fri, 16 Jun 2023 14:10:33 +0800 Subject: [PATCH] update space shooter --- .../StreamingAssetsHelper/StreamingAssetsHelper.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Assets/YooAsset/Samples~/Space Shooter/ThirdParty/StreamingAssetsHelper/StreamingAssetsHelper.cs b/Assets/YooAsset/Samples~/Space Shooter/ThirdParty/StreamingAssetsHelper/StreamingAssetsHelper.cs index aa37d57..240a2ff 100644 --- a/Assets/YooAsset/Samples~/Space Shooter/ThirdParty/StreamingAssetsHelper/StreamingAssetsHelper.cs +++ b/Assets/YooAsset/Samples~/Space Shooter/ThirdParty/StreamingAssetsHelper/StreamingAssetsHelper.cs @@ -23,6 +23,13 @@ public sealed class StreamingAssetsHelper private static bool _isInit = false; private static readonly HashSet _cacheData = new HashSet(); +#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 /// /// 初始化 /// @@ -49,6 +56,7 @@ public sealed class StreamingAssetsHelper return _cacheData.Contains(fileName); } +#endif } #if UNITY_EDITOR