From d3e37d18adb1d41278704641365ac360eead1180 Mon Sep 17 00:00:00 2001 From: hevinci Date: Wed, 21 Jun 2023 14:21:12 +0800 Subject: [PATCH] update space shooter --- .../StreamingAssetsHelper.cs | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/Assets/YooAsset/Samples~/Space Shooter/ThirdParty/StreamingAssetsHelper/StreamingAssetsHelper.cs b/Assets/YooAsset/Samples~/Space Shooter/ThirdParty/StreamingAssetsHelper/StreamingAssetsHelper.cs index 240a2ff..2091051 100644 --- a/Assets/YooAsset/Samples~/Space Shooter/ThirdParty/StreamingAssetsHelper/StreamingAssetsHelper.cs +++ b/Assets/YooAsset/Samples~/Space Shooter/ThirdParty/StreamingAssetsHelper/StreamingAssetsHelper.cs @@ -15,6 +15,19 @@ public class GameQueryServices : IQueryServices } } +#if UNITY_EDITOR +/// +/// StreamingAssets目录下资源查询帮助类 +/// +public sealed class StreamingAssetsHelper +{ + public static void Init() { } + public static bool FileExists(string fileName) + { + return File.Exists(Path.Combine(Application.streamingAssetsPath, "BuildinFiles", fileName)); + } +} +#else /// /// StreamingAssets目录下资源查询帮助类 /// @@ -23,13 +36,6 @@ 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 /// /// 初始化 /// @@ -53,11 +59,11 @@ public sealed class StreamingAssetsHelper { if (_isInit == false) Init(); - return _cacheData.Contains(fileName); } -#endif } +#endif + #if UNITY_EDITOR internal class PreprocessBuild : UnityEditor.Build.IPreprocessBuildWithReport