备份,准备做双端

This commit is contained in:
2026-07-30 23:15:58 +08:00
parent add675e45d
commit ec4ec53545
88 changed files with 4050 additions and 872 deletions
@@ -119,6 +119,8 @@ public class loadSkillsSelect : MonoBehaviour
return;
}
hero.ValidateEquippedSkillSelections();
List<SkillGroup> groupedSkills = hero.skillGroups == null
? new List<SkillGroup>()
: hero.skillGroups.Where(group => group != null).ToList();
@@ -439,6 +441,8 @@ public class loadSkillsSelect : MonoBehaviour
return;
}
currentHeroSO.ValidateEquippedSkillSelections();
HashSet<int> equippedIds = new HashSet<int>((currentHeroSO.equippedSkillGroupIDs ?? new int[0]).Where(id => id != 0));
for (int i = 0; i < spawnedSlots.Count; i++)
{
@@ -105,9 +105,10 @@ public class load_skill_detail_prefab_inHeroDetailPrefab : MonoBehaviour
return;
}
found.ValidateEquippedSkillSelections();
var equippedIds = (found.equippedSkillGroupIDs ?? new int[0]).Where(id => id != 0).ToList();
var levelInfo = AllyHeroLevelRuntimeResolver.GetBaseLevelInfo(found);
int currentMaxSlots = levelInfo?.skill_slot_limited ?? 0;
int currentMaxSlots = AllyHeroLevelRuntimeResolver.GetEffectiveSkillSlotLimit(found);
int maxSlotsOverall = 0;
if (found.levelStats != null && found.levelStats.Count > 0)
@@ -724,7 +724,15 @@ public class slots_heroSlots : MonoBehaviour, IDropHandler, IBeginDragHandler, I
// Find the AllyHero_SO
AllyHero_SO hero = FindHeroById(heroSlot_heroID);
if (hero == null || hero.equippedSkillGroupIDs == null)
if (hero == null)
{
RestoreLayoutState(layout, hadLayout);
return;
}
hero.ValidateEquippedSkillSelections();
if (hero.equippedSkillGroupIDs == null)
{
RestoreLayoutState(layout, hadLayout);
return;
@@ -157,13 +157,13 @@ public class slots_skillSlots : MonoBehaviour, IPointerClickHandler, IPointerEnt
SkillGroup skillGroup = so.GetSkillGroupByID(skillCard_skillID);
var levelInfo = AllyHeroLevelRuntimeResolver.GetBaseLevelInfo(so);
int currentLevel = levelInfo?.levelID ?? 0;
int requiredLevel = skillGroup?.thisSkill_levelLimit ?? 1;
int requiredLevel = Mathf.Clamp(skillGroup?.thisSkill_levelLimit ?? 1, 1, 4);
if (currentLevel < requiredLevel)
{
return SkillVisualState.Locked;
}
int maxSlots = levelInfo?.skill_slot_limited ?? int.MaxValue;
int maxSlots = so != null ? AllyHeroLevelRuntimeResolver.GetEffectiveSkillSlotLimit(so) : int.MaxValue;
int currentEquipped = so.equippedSkillGroupIDs != null ? so.equippedSkillGroupIDs.Where(id => id != 0).Count() : 0;
if (currentEquipped >= maxSlots)
{
@@ -192,8 +192,10 @@ public class slots_skillSlots : MonoBehaviour, IPointerClickHandler, IPointerEnt
{
// Documentation text normalized.
var levelInfo = AllyHeroLevelRuntimeResolver.GetBaseLevelInfo(so);
int maxSlots = levelInfo?.skill_slot_limited ?? int.MaxValue; // Documentation text normalized.
int currentEquipped = so?.equippedSkillGroupIDs.Where(id => id != 0).Count() ?? 0;
int maxSlots = so != null ? AllyHeroLevelRuntimeResolver.GetEffectiveSkillSlotLimit(so) : int.MaxValue; // Documentation text normalized.
int currentEquipped = so != null
? (so.equippedSkillGroupIDs ?? new int[0]).Where(id => id != 0).Count()
: 0;
if (currentEquipped >= maxSlots)
{
@@ -203,7 +205,7 @@ public class slots_skillSlots : MonoBehaviour, IPointerClickHandler, IPointerEnt
// Documentation text normalized.
var skillGroup = so?.GetSkillGroupByID(skillCard_skillID);
int requiredLevel = skillGroup?.thisSkill_levelLimit ?? 1;
int requiredLevel = Mathf.Clamp(skillGroup?.thisSkill_levelLimit ?? 1, 1, 4);
int currentLevel = levelInfo?.levelID ?? 0;
if (currentLevel < requiredLevel)
@@ -221,7 +223,7 @@ public class slots_skillSlots : MonoBehaviour, IPointerClickHandler, IPointerEnt
if (so != null)
{
var list = new System.Collections.Generic.List<int>(so.equippedSkillGroupIDs);
var list = new System.Collections.Generic.List<int>(so.equippedSkillGroupIDs ?? new int[0]);
if (isSelected)
{
if (!list.Contains(skillCard_skillID))
@@ -308,9 +310,9 @@ public class slots_skillSlots : MonoBehaviour, IPointerClickHandler, IPointerEnt
// Documentation text normalized.
string status;
var levelInfo = AllyHeroLevelRuntimeResolver.GetBaseLevelInfo(hero);
int maxSlots = levelInfo?.skill_slot_limited ?? int.MaxValue;
int currentEquipped = hero.equippedSkillGroupIDs.Where(id => id != 0).Count();
int requiredLevel = group.thisSkill_levelLimit;
int maxSlots = AllyHeroLevelRuntimeResolver.GetEffectiveSkillSlotLimit(hero);
int currentEquipped = (hero.equippedSkillGroupIDs ?? new int[0]).Where(id => id != 0).Count();
int requiredLevel = Mathf.Clamp(group.thisSkill_levelLimit, 1, 4);
int currentLevel = levelInfo?.levelID ?? 0;
if (currentLevel < requiredLevel)