From e58184bd005eac2915eafea43b513735a3ad59be Mon Sep 17 00:00:00 2001 From: Ding Yuntian <1491671119@qq.com> Date: Wed, 17 Dec 2025 20:52:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E4=BB=B6=E7=B3=BB=E7=BB=9F=E5=AE=89?= =?UTF-8?q?=E5=8D=93=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/Framework/Config/ConfigUtil.cs | 5 +- Assets/Scripts/Framework/LogKit/LogKit.cs | 5 +- Assets/Scripts/Game Loop/ChapterController.cs | 2 + Assets/Scripts/Game Loop/SettingLoader.cs | 3 +- Assets/Scripts/UI/Cursor/CursorManager.cs | 3 + Assets/Scripts/UI/Panel/SavesPanel.cs | 77 --------------- Assets/Scripts/UI/Panel/SavesPanel.cs.meta | 3 - Assets/Scripts/UI/SaveFileUIController.cs | 59 ----------- .../Scripts/UI/SaveFileUIController.cs.meta | 11 --- Assets/Scripts/Utility/ConstRef.cs | 9 +- Assets/Scripts/Utility/CsvUtil.cs | 98 +++++++++++++++++-- Assets/Scripts/Utility/JsonUtil.cs | 66 +++++++++++-- 12 files changed, 167 insertions(+), 174 deletions(-) delete mode 100644 Assets/Scripts/UI/Panel/SavesPanel.cs delete mode 100644 Assets/Scripts/UI/Panel/SavesPanel.cs.meta delete mode 100644 Assets/Scripts/UI/SaveFileUIController.cs delete mode 100644 Assets/Scripts/UI/SaveFileUIController.cs.meta diff --git a/Assets/Scripts/Framework/Config/ConfigUtil.cs b/Assets/Scripts/Framework/Config/ConfigUtil.cs index 6755fe061..56583a3bc 100644 --- a/Assets/Scripts/Framework/Config/ConfigUtil.cs +++ b/Assets/Scripts/Framework/Config/ConfigUtil.cs @@ -13,7 +13,6 @@ namespace AibisDream.Kit { public class ConfigUtil : SingletonBase { - private const string CharacterConfigPath = "/Config/character.csv"; private const string SpriteGroupPath = "/Config/sprite_group.json"; private Dictionary _characters; @@ -42,12 +41,12 @@ namespace AibisDream.Kit public override void OnSingletonInit() { InitCharacterConfig(); - InitSpriteGroupConfig(); + // InitSpriteGroupConfig(); } private void InitCharacterConfig() { - var characterList = CsvUtil.ReadAsBean(Application.streamingAssetsPath + CharacterConfigPath); + var characterList = CsvUtil.ReadAsBean(ConstRef.CharacterConfigPath); _characters = characterList.ToDictionary(item => item.Key, item => item); } diff --git a/Assets/Scripts/Framework/LogKit/LogKit.cs b/Assets/Scripts/Framework/LogKit/LogKit.cs index 013ff13e9..d48e622f0 100644 --- a/Assets/Scripts/Framework/LogKit/LogKit.cs +++ b/Assets/Scripts/Framework/LogKit/LogKit.cs @@ -1,4 +1,5 @@ using System; +using System.IO; using UnityEngine; namespace AibisDream.Kit @@ -14,7 +15,7 @@ namespace AibisDream.Kit /// /// 日志文件路径 /// - public static string LogPath => Application.streamingAssetsPath + "/LogFile"; + public static string LogPath => Path.Combine(Application.streamingAssetsPath, "LogFile"); /// /// 日志保存最近几天的内容 @@ -32,7 +33,7 @@ namespace AibisDream.Kit private void Awake() { -#if !UNITY_EDITOR +#if !UNITY_EDITOR && !UNITY_ANDROID && !UNITY_IOS DontDestroyOnLoad(gameObject); _fileLogger = new FileLogger(LogFileName, LogPath, SaveDays); LogMessage($"Ver.{Application.version}", "", LogType.Log); diff --git a/Assets/Scripts/Game Loop/ChapterController.cs b/Assets/Scripts/Game Loop/ChapterController.cs index cbb251d0b..412e9910e 100644 --- a/Assets/Scripts/Game Loop/ChapterController.cs +++ b/Assets/Scripts/Game Loop/ChapterController.cs @@ -112,7 +112,9 @@ namespace AibisDream public void SaveUnloadChapters() { +#if !UNITY_ANDROID || UNITY_EDITOR JsonUtil.SaveArray(unlockedChapterList.ToArray(), ConstRef.ChapterProgressPath); +#endif } public bool TryGetSaveFilePath(out string saveFilePath) diff --git a/Assets/Scripts/Game Loop/SettingLoader.cs b/Assets/Scripts/Game Loop/SettingLoader.cs index 6a160627b..78dc07d29 100644 --- a/Assets/Scripts/Game Loop/SettingLoader.cs +++ b/Assets/Scripts/Game Loop/SettingLoader.cs @@ -4,6 +4,7 @@ using AibisDream.Framework; using AibisDream.Kit; using AibisDream.UI; using UnityEngine; +using System.IO; namespace AibisDream { @@ -12,7 +13,7 @@ namespace AibisDream /// public class SettingLoader { - private static readonly string SettingPath = Application.streamingAssetsPath + "/Config/setting.json"; + private static readonly string SettingPath = Path.Combine(Application.streamingAssetsPath, "Config", "setting.json"); private readonly ConfigContainer _container; diff --git a/Assets/Scripts/UI/Cursor/CursorManager.cs b/Assets/Scripts/UI/Cursor/CursorManager.cs index 187f4530d..a432a127b 100644 --- a/Assets/Scripts/UI/Cursor/CursorManager.cs +++ b/Assets/Scripts/UI/Cursor/CursorManager.cs @@ -23,6 +23,9 @@ namespace AibisDream private void InitCursor() { +#if UNITY_ANDROID || UNITY_IOS + _cursor.gameObject.SetActive(false); +#endif Cursor.visible = false; _cursor.sprite = defaultCursor; } diff --git a/Assets/Scripts/UI/Panel/SavesPanel.cs b/Assets/Scripts/UI/Panel/SavesPanel.cs deleted file mode 100644 index e20dffa1a..000000000 --- a/Assets/Scripts/UI/Panel/SavesPanel.cs +++ /dev/null @@ -1,77 +0,0 @@ -using System.IO; -using System.Linq; -using TMPro; -using UnityEngine; -using UnityEngine.UI; - -namespace AibisDream.UI -{ - public class SavesPanel : MonoBehaviour, IUIPanel - { - public bool IsOpen => gameObject.activeSelf; - public bool IsCloseable => true; - - private static readonly string SaveFilePath = Application.streamingAssetsPath + "/SaveFiles"; - - #region 索引 - public Button buttonPrefab; - public Transform buttonParent; - #endregion - - #region 打开和关闭 - - public void Show() - { - InitLevelBtn(); - gameObject.SetActive(true); - RegisterButton(); - } - - public void Hide() - { - gameObject.SetActive(false); - UnRegisterButton(); - } - - private void RegisterButton() - { - var returnBtn = transform.Find("Return").GetComponent