This commit is contained in:
SoulliesOfficial
2025-12-11 17:25:49 -05:00
parent f7cab3e784
commit b54c5f796b
17 changed files with 113 additions and 36 deletions

View File

@@ -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);