diff --git a/Unity/Assets/Scripts/TH1_Logic/Achievement/AchievementDataManager.cs b/Unity/Assets/Scripts/TH1_Logic/Achievement/AchievementDataManager.cs index 5bb19644d..ef7e57d08 100644 --- a/Unity/Assets/Scripts/TH1_Logic/Achievement/AchievementDataManager.cs +++ b/Unity/Assets/Scripts/TH1_Logic/Achievement/AchievementDataManager.cs @@ -45,40 +45,7 @@ namespace RuntimeData string path = Application.persistentDataPath + "/../Config/achievement.json"; string backupPath = path + ".bak"; - // 临时代码,如果找不到新路径下的成就存档,就从旧的存档里进行恢复操作,默认读最近五个档 - if (!File.Exists(path)) - { - Achievement = asset.Data; - Achievement.ClearAchievementFinishedInfo(); - - var achievements = new List(); - foreach (var version in ConfigManager.Instance.VersionCfg.Versions) - { - var oldPath = Application.persistentDataPath + $"/../TOHOTOPIA Demo v{version.Version}/achievement.json"; - achievements.Add(TryReadAchievementData(oldPath)); - oldPath = Application.persistentDataPath + $"/../TOHOTOPIA Demo v{version.WindowsVersion}/achievement.json"; - achievements.Add(TryReadAchievementData(oldPath)); - oldPath = Application.persistentDataPath + $"/../TOHOTOPIA Demo v{version.OldFullVersion}/achievement.json"; - achievements.Add(TryReadAchievementData(oldPath)); - oldPath = Application.persistentDataPath + $"/../TOHOTOPIA Demo v{version.OldWindowsFullVersion}/achievement.json"; - achievements.Add(TryReadAchievementData(oldPath)); - } - - foreach (var item in Achievement.AchievementList) - { - foreach (var old in achievements) - { - if (old == null) continue; - var target = old.GetAchievementItem(item.BigID, item.SmallID, item.InternalID); - item.CopyChange(target); - } - } - } - else - { - // 尝试读取主文件 - Achievement = TryReadAchievementData(path); - } + if (File.Exists(path)) Achievement = TryReadAchievementData(path); // 主文件损坏,尝试从备份恢复 if (Achievement == null && File.Exists(backupPath)) diff --git a/Unity/Assets/Scripts/TH1_Logic/Editor/BuildEditor.cs b/Unity/Assets/Scripts/TH1_Logic/Editor/BuildEditor.cs index 53aa48a85..29339fe0b 100644 --- a/Unity/Assets/Scripts/TH1_Logic/Editor/BuildEditor.cs +++ b/Unity/Assets/Scripts/TH1_Logic/Editor/BuildEditor.cs @@ -204,7 +204,7 @@ namespace Logic.Editor AddDefine(STEAM_CHANNEL); AddDefine(USE_INPUT); _asset.CurVersionId = selectedVersion.VersionId; - PlayerSettings.productName = $"TOHOTOPIA Demo"; + PlayerSettings.productName = $"TOHOTOPIA"; EditorUtility.SetDirty(_asset); AssetDatabase.SaveAssets(); // 更新Unity版本号 @@ -231,7 +231,7 @@ namespace Logic.Editor RemoveDefine(STEAM_TEST); RemoveDefine(USE_INPUT); _asset.CurVersionId = selectedVersion.VersionId; - PlayerSettings.productName = $"TOHOTOPIA Demo"; + PlayerSettings.productName = $"TOHOTOPIA"; EditorUtility.SetDirty(_asset); AssetDatabase.SaveAssets(); diff --git a/Unity/Assets/Scripts/TH1_Logic/Editor/BuildProcessEditor.cs b/Unity/Assets/Scripts/TH1_Logic/Editor/BuildProcessEditor.cs index 723025b4c..73f40b3a5 100644 --- a/Unity/Assets/Scripts/TH1_Logic/Editor/BuildProcessEditor.cs +++ b/Unity/Assets/Scripts/TH1_Logic/Editor/BuildProcessEditor.cs @@ -19,13 +19,13 @@ namespace Logic.Editor if (asset != null) { // 设置exe文件名 - PlayerSettings.productName = $"TOHOTOPIA Demo v{asset.CurVersionInfo.FullVersion}"; + PlayerSettings.productName = $"TOHOTOPIA v{asset.CurVersionInfo.FullVersion}"; } } public void OnPostprocessBuild(BuildReport report) { - PlayerSettings.productName = $"TOHOTOPIA Demo"; + PlayerSettings.productName = $"TOHOTOPIA"; } } } \ No newline at end of file diff --git a/Unity/Assets/Scripts/TH1_Logic/GameRecord/GameRecordManager.cs b/Unity/Assets/Scripts/TH1_Logic/GameRecord/GameRecordManager.cs index e67d44939..d6619a250 100644 --- a/Unity/Assets/Scripts/TH1_Logic/GameRecord/GameRecordManager.cs +++ b/Unity/Assets/Scripts/TH1_Logic/GameRecord/GameRecordManager.cs @@ -120,38 +120,8 @@ namespace RuntimeData string path = Application.persistentDataPath + "/../Config/game_record.dat"; string backupPath = path + ".bak"; - - // 临时代码,如果找不到新路径下的成就存档,就从旧的存档里进行恢复操作,默认读最近五个档 - if (!File.Exists(path)) - { - _gameRecord = new GameRecordData(); - var records = new List(); - foreach (var version in ConfigManager.Instance.VersionCfg.Versions) - { - var oldPath = Application.persistentDataPath + $"/../TOHOTOPIA Demo v{version.Version}/game_record.dat"; - records.Add(FileTools.TryDeserializeFile(oldPath)); - oldPath = Application.persistentDataPath + $"/../TOHOTOPIA Demo v{version.WindowsVersion}/game_record.dat"; - records.Add(FileTools.TryDeserializeFile(oldPath)); - oldPath = Application.persistentDataPath + $"/../TOHOTOPIA Demo v{version.OldFullVersion}/game_record.dat"; - records.Add(FileTools.TryDeserializeFile(oldPath)); - oldPath = Application.persistentDataPath + $"/../TOHOTOPIA Demo v{version.OldWindowsFullVersion}/game_record.dat"; - records.Add(FileTools.TryDeserializeFile(oldPath)); - } - - foreach (var record in records) - { - if (record == null) continue; - foreach (var item in record.Records) - { - _gameRecord.Records.Add(item); - } - } - } - else - { - // 尝试读取主文件 - _gameRecord = FileTools.TryDeserializeFile(path); - } + + if (File.Exists(path)) _gameRecord = FileTools.TryDeserializeFile(path); // 主文件损坏,尝试从备份恢复 if (_gameRecord == null && File.Exists(backupPath)) diff --git a/Unity/Assets/Scripts/TH1_UI/BoardingUI.cs b/Unity/Assets/Scripts/TH1_UI/BoardingUI.cs index 14faa7325..348db2c57 100644 --- a/Unity/Assets/Scripts/TH1_UI/BoardingUI.cs +++ b/Unity/Assets/Scripts/TH1_UI/BoardingUI.cs @@ -138,7 +138,7 @@ namespace UI versionLabelMono.VersionId = versionInfo.VersionId; // 使用字符串插值,代码更清晰 - txt.text = $"Demo V{versionInfo.MajorVersion}.{versionInfo.MinorVersion}.{versionInfo.PatchVersion}"; + txt.text = $"V{versionInfo.MajorVersion}.{versionInfo.MinorVersion}.{versionInfo.PatchVersion}"; // 为按钮添加点击监听器 button.onClick.AddListener(() => diff --git a/Unity/Assets/Scripts/TH1_UI/View/Outside/UIOutsideMenuAboutPanelMono.cs b/Unity/Assets/Scripts/TH1_UI/View/Outside/UIOutsideMenuAboutPanelMono.cs index 0b1fce3b8..890bb72bd 100644 --- a/Unity/Assets/Scripts/TH1_UI/View/Outside/UIOutsideMenuAboutPanelMono.cs +++ b/Unity/Assets/Scripts/TH1_UI/View/Outside/UIOutsideMenuAboutPanelMono.cs @@ -69,7 +69,7 @@ namespace TH1_UI.View.Outside BlockButton.onClick.AddListener(OnClose); gameObject.SetActive(false); if (VersionLabel != null) - VersionLabel.text = "Demo V" + ConfigManager.Instance.VersionCfg.CurVersionInfo.FullVersion; + VersionLabel.text = "V" + ConfigManager.Instance.VersionCfg.CurVersionInfo.FullVersion; BindUrlButton(BilibiliButton, BilibiliUrl); BindUrlButton(WebsiteButton, WebsiteUrl); BindUrlButton(XButton, XUrl); diff --git a/Unity/Assets/Scripts/TH1_UI/View/Outside/UIOutsideMenuView.cs b/Unity/Assets/Scripts/TH1_UI/View/Outside/UIOutsideMenuView.cs index c1f144980..e9f40a142 100644 --- a/Unity/Assets/Scripts/TH1_UI/View/Outside/UIOutsideMenuView.cs +++ b/Unity/Assets/Scripts/TH1_UI/View/Outside/UIOutsideMenuView.cs @@ -140,7 +140,7 @@ namespace TH1_UI.View.Outside AboutButton.onClick.AddListener(OnAboutClicked); ShutdownButton.onClick.RemoveAllListeners(); ShutdownButton.onClick.AddListener(OnShutdownClicked); - QQHintVersion.text = "Demo V" + ConfigManager.Instance.VersionCfg.CurVersionInfo.FullVersion; + QQHintVersion.text = "V" + ConfigManager.Instance.VersionCfg.CurVersionInfo.FullVersion; //Step #6 设置BGM AudioManager.Instance.PlayMusic("Main",1f,2f,true);