去除demo

This commit is contained in:
wuwenbo 2026-05-13 21:49:44 +08:00
parent 7cf80b6937
commit 351cb42986
7 changed files with 10 additions and 73 deletions

View File

@ -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<AchievementData>();
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))

View File

@ -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();

View File

@ -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";
}
}
}

View File

@ -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<GameRecordData>();
foreach (var version in ConfigManager.Instance.VersionCfg.Versions)
{
var oldPath = Application.persistentDataPath + $"/../TOHOTOPIA Demo v{version.Version}/game_record.dat";
records.Add(FileTools.TryDeserializeFile<GameRecordData>(oldPath));
oldPath = Application.persistentDataPath + $"/../TOHOTOPIA Demo v{version.WindowsVersion}/game_record.dat";
records.Add(FileTools.TryDeserializeFile<GameRecordData>(oldPath));
oldPath = Application.persistentDataPath + $"/../TOHOTOPIA Demo v{version.OldFullVersion}/game_record.dat";
records.Add(FileTools.TryDeserializeFile<GameRecordData>(oldPath));
oldPath = Application.persistentDataPath + $"/../TOHOTOPIA Demo v{version.OldWindowsFullVersion}/game_record.dat";
records.Add(FileTools.TryDeserializeFile<GameRecordData>(oldPath));
}
foreach (var record in records)
{
if (record == null) continue;
foreach (var item in record.Records)
{
_gameRecord.Records.Add(item);
}
}
}
else
{
// 尝试读取主文件
_gameRecord = FileTools.TryDeserializeFile<GameRecordData>(path);
}
if (File.Exists(path)) _gameRecord = FileTools.TryDeserializeFile<GameRecordData>(path);
// 主文件损坏,尝试从备份恢复
if (_gameRecord == null && File.Exists(backupPath))

View File

@ -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(() =>

View File

@ -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);

View File

@ -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);