修了很多bug和增加功能,优化不少问题

This commit is contained in:
2026-02-28 06:59:22 +08:00
parent 508a40bba0
commit e11cc1da7a
345 changed files with 173803 additions and 69332 deletions
@@ -1,4 +1,4 @@
using UnityEngine;
using UnityEngine;
using UnityEngine.UI;
public class loadSettlementTeamPrefab : MonoBehaviour
@@ -105,12 +105,23 @@ public class loadSettlementTeamPrefab : MonoBehaviour
continue;
}
// Attempt to resolve an AllyHero_SO for this slot (via teamUIController.allySlotIds) so we can prefer its squareProfile
AllyHero_SO resolvedHeroSO = null;
int allyId = -1;
// Check if this slot is active and has an assigned hero
var ui = tuic ?? teamUIController.Instance;
bool isSlotActive = (ui != null) && ui.IsAllySlotActive(i);
int allyId = -1;
if (ui != null && ui.allySlotIds != null && i < ui.allySlotIds.Count)
allyId = ui.allySlotIds[i];
if (!isSlotActive || allyId <= 0)
{
card.SetEmptyState();
if (GameConfig.verboseLogs) Debug.Log($"[loadSettlementTeamPrefab] Slot {i + 1} is inactive or has no character (id={allyId}). Applied empty state.");
continue;
}
// Attempt to resolve an AllyHero_SO for this slot (via teamUIController.allySlotIds) so we can prefer its squareProfile
AllyHero_SO resolvedHeroSO = null;
if (allyId > 0)
{
var arr = Resources.LoadAll<AllyHero_SO>("");
@@ -1,4 +1,4 @@
using UnityEngine;
using UnityEngine;
using UnityEngine.UI;
public class settleTeamPrefab : MonoBehaviour
@@ -20,6 +20,45 @@ public class settleTeamPrefab : MonoBehaviour
public Button displayDetailContributionButton;
public GameObject detailContributionGO;
public void SetEmptyState()
{
// 1. Ally profile to transparent
if (ally_profile != null)
{
ally_profile.color = new Color(1f, 1f, 1f, 0f);
}
// 2. Name to "——"
if (ally_name != null)
{
ally_name.text = "——";
}
// 3. Health bar to 0
if (ally_healthBar != null)
{
ally_healthBar.fillAmount = 0f;
}
// 4. Statistics to "-"
if (thisAlly_earnExp != null) thisAlly_earnExp.text = "-";
if (this_allyIdolScore != null) this_allyIdolScore.text = "-";
if (this_allyDamageDealt != null) this_allyDamageDealt.text = "-";
if (this_allyDamageTook != null) this_allyDamageTook.text = "-";
if (this_allyHealthRestored != null) this_allyHealthRestored.text = "-";
if (this_allyManaRestored != null) this_allyManaRestored.text = "-";
// 5. Hide buttons/details
if (displayDetailContributionButton != null)
{
displayDetailContributionButton.gameObject.SetActive(false);
}
if (detailContributionGO != null)
{
detailContributionGO.SetActive(false);
}
}
private void Start()
{
// Documentation text normalized.