客户端rsa,冗余清理,bug修复,安卓build问题
This commit is contained in:
@@ -35,6 +35,7 @@ public static class PackagingResetTool
|
||||
"将执行以下重置(仅玩家进度,不改配置/解锁/技能配装):\n\n" +
|
||||
"1. 玩家:金币、材料、经验、等级清零\n" +
|
||||
"2. 英雄:经验、成长阶位、自动突破、等级锁、出战/完成/MVP 统计、入队日期清零\n" +
|
||||
"2.5 歌曲:游玩次数、累计时长、各难度成绩记录清零(歌曲解锁/谱面配置不动)\n" +
|
||||
"3. 装备:删除 " + GeneratedEquipmentFolder + " 下所有生成装备,清除英雄已装备引用\n" +
|
||||
"4. 商店:所有物品 purchasedCount、user_has_read 清零(限购配置 itemPurchaseQuota 不动)\n" +
|
||||
"5. 清理本机测试存档(.cache_bridge 货币/成长/装备/商店存档,不含拥有权账本)与相关 PlayerPrefs\n\n" +
|
||||
@@ -56,6 +57,7 @@ public static class PackagingResetTool
|
||||
|
||||
errors += ResetPlayers(report);
|
||||
errors += ResetHeroes(report);
|
||||
errors += ResetSongs(report);
|
||||
errors += DeleteGeneratedEquipmentAssets(report);
|
||||
errors += ResetStoreItems(report);
|
||||
}
|
||||
@@ -160,6 +162,68 @@ public static class PackagingResetTool
|
||||
return 0;
|
||||
}
|
||||
|
||||
private static int ResetSongs(StringBuilder report)
|
||||
{
|
||||
int count = 0;
|
||||
int charts = 0;
|
||||
foreach (var guid in AssetDatabase.FindAssets("t:SongData"))
|
||||
{
|
||||
string path = AssetDatabase.GUIDToAssetPath(guid);
|
||||
var so = AssetDatabase.LoadAssetAtPath<SongData>(path);
|
||||
if (so == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var serialized = new SerializedObject(so);
|
||||
// 顶层游玩进度(不动 songID / isUnlocked / bpm / 谱面配置等)。
|
||||
SetStringIfPresent(serialized, "usernameID", string.Empty);
|
||||
SetIntIfPresent(serialized, "game_enterTimes", 0);
|
||||
SetFloatIfPresent(serialized, "time_totalPlayingTime", 0f);
|
||||
|
||||
// 逐难度成绩记录(chartFiles 数组内),只清成绩,保留难度/敌人/谱面配置。
|
||||
var chartFiles = serialized.FindProperty("chartFiles");
|
||||
if (chartFiles != null && chartFiles.isArray)
|
||||
{
|
||||
for (int i = 0; i < chartFiles.arraySize; i++)
|
||||
{
|
||||
var entry = chartFiles.GetArrayElementAtIndex(i);
|
||||
SetChildInt(entry, "lastScoreForThisDifficulty", 0);
|
||||
SetChildInt(entry, "chartPersonalRecordForThisDifficulty", 0);
|
||||
SetChildInt(entry, "idolPersonalRecordForThisDifficulty", 0);
|
||||
SetChildInt(entry, "totalPersonalRecordForThisDifficulty", 0);
|
||||
SetChildFloat(entry, "levelProgressForThisDifficulty", 0f);
|
||||
charts++;
|
||||
}
|
||||
}
|
||||
|
||||
serialized.ApplyModifiedPropertiesWithoutUndo();
|
||||
EditorUtility.SetDirty(so);
|
||||
count++;
|
||||
}
|
||||
|
||||
report.AppendLine("歌曲资产已重置:" + count + " 个 SongData(游玩次数/时长/" + charts + " 条难度成绩记录)。");
|
||||
return 0;
|
||||
}
|
||||
|
||||
private static void SetChildInt(SerializedProperty parent, string field, int value)
|
||||
{
|
||||
var prop = parent.FindPropertyRelative(field);
|
||||
if (prop != null)
|
||||
{
|
||||
prop.intValue = value;
|
||||
}
|
||||
}
|
||||
|
||||
private static void SetChildFloat(SerializedProperty parent, string field, float value)
|
||||
{
|
||||
var prop = parent.FindPropertyRelative(field);
|
||||
if (prop != null)
|
||||
{
|
||||
prop.floatValue = value;
|
||||
}
|
||||
}
|
||||
|
||||
private static int DeleteGeneratedEquipmentAssets(StringBuilder report)
|
||||
{
|
||||
if (!AssetDatabase.IsValidFolder(GeneratedEquipmentFolder))
|
||||
|
||||
Reference in New Issue
Block a user