修复
This commit is contained in:
@@ -40,6 +40,12 @@ namespace Continentis.MainGame.UI
|
||||
discardPile.cardViews.Clear();
|
||||
exhaustPile.cardViews.Clear();
|
||||
gravePile.cardViews.Clear();
|
||||
|
||||
drawPile.UpdateCountText();
|
||||
handPile.UpdateCountText();
|
||||
discardPile.UpdateCountText();
|
||||
exhaustPile.UpdateCountText();
|
||||
gravePile.UpdateCountText();
|
||||
}
|
||||
|
||||
public PileBase Pile(string pileName)
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace Continentis.MainGame.UI
|
||||
if (count == 0 || index < 0)
|
||||
return Vector2.zero;
|
||||
|
||||
float cardSpacing = cardSpacingBase + cardSpacingFactor / count;
|
||||
float cardSpacing = cardSpacingBase + Mathf.Max((cardSpacingFactor - (count * 20)), -200) / count;
|
||||
|
||||
// 计算中间索引,保证手牌居中排列
|
||||
float midIndex = (count - 1) / 2f;
|
||||
|
||||
@@ -15,7 +15,6 @@ namespace Continentis.MainGame.UI
|
||||
{
|
||||
base.Awake();
|
||||
cardViews = new List<CardViewBase>();
|
||||
UpdateCountText();
|
||||
}
|
||||
|
||||
public virtual void AddCard(CardViewBase cardObject)
|
||||
@@ -40,7 +39,7 @@ namespace Continentis.MainGame.UI
|
||||
//Debug.Log($"Removed {cardObject.cardInstance.cardLogic.contentSubmodule.cardName} from {this.name}" );
|
||||
}
|
||||
|
||||
private void UpdateCountText()
|
||||
public void UpdateCountText()
|
||||
{
|
||||
if (cardCountText != null)
|
||||
{
|
||||
|
||||
@@ -21,24 +21,24 @@ namespace Continentis.MainGame.UI
|
||||
|
||||
button.onClick.AddListener(() =>
|
||||
{
|
||||
isTeam = !isTeam;
|
||||
if (isTeam)
|
||||
{
|
||||
SwitchToTeam();
|
||||
buttonText.text = "Team";
|
||||
teamPileText.gameObject.SetActive(true);
|
||||
SwitchToCurrentCharacter();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
SwitchToCurrentCharacter();
|
||||
buttonText.text = "Hero";
|
||||
teamPileText.gameObject.SetActive(false);
|
||||
SwitchToTeam();
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void SwitchToTeam()
|
||||
public void SwitchToTeam()
|
||||
{
|
||||
if(isTeam) return;
|
||||
isTeam = true;
|
||||
|
||||
Sequence seq = DOTween.Sequence();
|
||||
seq.Append(CombatUIManager.Instance.combatMainPage.handPile.rectTransform.DOAnchorPosY(-300f, 0.2f)
|
||||
.OnComplete(() =>
|
||||
@@ -49,6 +49,8 @@ namespace Continentis.MainGame.UI
|
||||
{
|
||||
card.user = CombatMainManager.Instance.currentCharacter;
|
||||
card.RefreshCardAttributes();
|
||||
buttonText.text = "Team";
|
||||
teamPileText.gameObject.SetActive(true);
|
||||
});
|
||||
}));
|
||||
|
||||
@@ -57,8 +59,10 @@ namespace Continentis.MainGame.UI
|
||||
seq.Play();
|
||||
}
|
||||
|
||||
private void SwitchToCurrentCharacter()
|
||||
public void SwitchToCurrentCharacter()
|
||||
{
|
||||
if(!isTeam) return;
|
||||
isTeam = false;
|
||||
if (CombatMainManager.Instance.currentCharacter is PlayerHero playerHero)
|
||||
{
|
||||
Sequence seq = DOTween.Sequence();
|
||||
@@ -67,6 +71,8 @@ namespace Continentis.MainGame.UI
|
||||
{
|
||||
CombatUIManager.Instance.combatMainPage.ClearAllCardViews();
|
||||
playerHero.deckSubmodule.SetUpHandCardViews();
|
||||
buttonText.text = "Hero";
|
||||
teamPileText.gameObject.SetActive(false);
|
||||
}));
|
||||
seq.AppendInterval(0.1f);
|
||||
seq.Append(CombatUIManager.Instance.combatMainPage.handPile.rectTransform.DOAnchorPosY(80f, 0.2f));
|
||||
@@ -81,6 +87,8 @@ namespace Continentis.MainGame.UI
|
||||
public void UpdateTeamPileText(CombatTeam team)
|
||||
{
|
||||
int currentCardCount = team.deckSubmodule.HandPile.Count;
|
||||
|
||||
Debug.Log($"Current team hand pile count: {currentCardCount}");
|
||||
|
||||
gameObject.SetActive(currentCardCount != 0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user