修复了build guard等若干问题

This commit is contained in:
FloatGaming
2026-07-14 03:34:17 +08:00
parent f8985d91d2
commit 020ca473c7
58 changed files with 267 additions and 424 deletions
+28
View File
@@ -27,6 +27,7 @@ public sealed class PackagingBuildGuard : IPreprocessBuildWithReport
CheckPlayers(problems);
CheckHeroes(problems);
CheckSongs(problems);
CheckMails(problems);
if (problems.Count == 0)
{
@@ -156,5 +157,32 @@ public sealed class PackagingBuildGuard : IPreprocessBuildWithReport
}
}
}
private static void CheckMails(List<string> problems)
{
foreach (var guid in AssetDatabase.FindAssets("t:mail_so"))
{
string path = AssetDatabase.GUIDToAssetPath(guid);
var so = AssetDatabase.LoadAssetAtPath<mail_so>(path);
if (so == null) continue;
// 跳过 mail_id = 0 的模板文件。
if (so.mail_id == 0) continue;
// 标记未领取(isReceived:0)且携带奖励的邮件 → 新玩家首启会自动领取。
if (!so.isReceived && so.rewardList != null && so.rewardList.Count > 0)
{
int totalRewards = 0;
foreach (var reward in so.rewardList)
{
totalRewards += reward.reward_ammount;
}
if (totalRewards > 0)
{
problems.Add(path + " :: mail_id=" + so.mail_id + " 未领取且含 " + so.rewardList.Count + " 项奖励(新玩家会自动领取)");
}
}
}
}
}
#endif