彻底修好了

This commit is contained in:
SoulliesOfficial
2025-11-13 10:42:05 -05:00
parent c62d86ddb2
commit c09dae7783
12 changed files with 48 additions and 54 deletions

View File

@@ -9,7 +9,8 @@ namespace Continentis.MainGame.UI
public bool isUpdatingLayout = true; // 是否启用自动布局更新
public float arcAngle = 15; // 手牌的总弧度
//public float cardSpacing = 150f; // 手牌间距
public float cardSpacingBase = 100f; // 手牌间距
public float cardSpacingFactor = 500f; // 手牌间距调整因子
public float maxVerticalOffset = 50f; // 控制最外侧卡牌的垂直偏移
private void Update()
@@ -25,7 +26,7 @@ namespace Continentis.MainGame.UI
if (count == 0 || index < 0)
return Vector2.zero;
float cardSpacing = 100f + 500f / count;
float cardSpacing = cardSpacingBase + cardSpacingFactor / count;
// 计算中间索引,保证手牌居中排列
float midIndex = (count - 1) / 2f;

View File

@@ -14,6 +14,7 @@ namespace Continentis.MainGame.UI
public bool isTeam;
public Button button;
public TMP_Text buttonText;
public TMP_Text teamPileText;
private void Awake()
{
isTeam = false;
@@ -25,11 +26,13 @@ namespace Continentis.MainGame.UI
{
SwitchToTeam();
buttonText.text = "Team";
teamPileText.gameObject.SetActive(true);
}
else
{
SwitchToCurrentCharacter();
buttonText.text = "Hero";
teamPileText.gameObject.SetActive(false);
}
});
}
@@ -74,5 +77,12 @@ namespace Continentis.MainGame.UI
throw new Exception("当前角色不是玩家角色,无法显示卡牌。");
}
}
public void UpdateTeamPileText(CombatTeam team)
{
int currentCardCount = team.deckSubmodule.HandPile.Count;
teamPileText.text = $"{currentCardCount}/10";
Debug.Log($"Updated team pile text: {teamPileText.text}");
}
}
}

View File

@@ -1,5 +1,6 @@
using Continentis.MainGame.Card;
using Continentis.MainGame.Character;
using Continentis.MainGame.Combat;
using Continentis.MainGame.UI;
using UnityEngine;
using UnityEngine.InputSystem;
@@ -37,6 +38,11 @@ namespace Continentis.MainGame
{
return uiPageList.Count == 1 && uiPageList.Contains(combatMainPage);
}
public void UpdateAll()
{
combatMainPage.teamSwitchButton.UpdateTeamPileText(CombatMainManager.Instance.characterController.playerTeam);
}
}
public partial class CombatUIManager

View File

@@ -65,7 +65,7 @@ namespace Continentis.MainGame.UI
{
string paramKey = synchronizedParameters[index];
Func<string> func = buff.contentSubmodule.parameterGetters[paramKey];
Debug.Log($"Updating buff icon text for parameter {paramKey} with func is {func != null}");
//Debug.Log($"Updating buff icon text for parameter {paramKey} with func is {func != null}");
SetText(index, func);
}