加入很多新内容,这波一块交了

This commit is contained in:
2026-04-08 20:53:41 +08:00
parent d9376833b6
commit 85dfff28dd
128 changed files with 14546 additions and 474 deletions
+9 -2
View File
@@ -15,6 +15,7 @@ using TMPro;
/// </summary>
public class AllyCombatant : MonoBehaviour, ICombatant
{
private static AllyHero_SO[] cachedAllAllyHeroes;
public int slotIndex = 0; // Documentation text normalized.
// runtime stats
@@ -989,8 +990,8 @@ public class AllyCombatant : MonoBehaviour, ICombatant
if (id > 0)
{
var all = Resources.LoadAll<AllyHero_SO>("");
foreach (var a in all)
EnsureAllyHeroCache();
foreach (var a in cachedAllAllyHeroes)
{
if (a != null && a.ally_heroID == id)
{
@@ -1049,6 +1050,12 @@ public class AllyCombatant : MonoBehaviour, ICombatant
}
}
private static void EnsureAllyHeroCache()
{
if (cachedAllAllyHeroes != null) return;
cachedAllAllyHeroes = Resources.LoadAll<AllyHero_SO>("") ?? Array.Empty<AllyHero_SO>();
}
// Documentation text normalized.
private static AllyHero_SO.AllyLevelInfo GetEffectiveLevelForExp(AllyHero_SO so, int exp)
{