Setup more of the card system stuff

This commit is contained in:
Michal Pikulski
2025-10-17 16:17:50 +02:00
committed by Michal Adam Pikulski
parent b1df36d48c
commit 80005e6b7d
8 changed files with 1029 additions and 1703 deletions

View File

@@ -23,8 +23,7 @@ namespace AppleHills.UI.CardSystem
[Header("UI Elements")]
[SerializeField] private Button backpackButton;
[SerializeField] private Text boosterCountText;
[SerializeField] private GameObject notificationDot;
[SerializeField] private BoosterNotificationDot boosterNotificationDot; // Changed to BoosterNotificationDot
[SerializeField] private GameObject backpackAnimationTarget;
[SerializeField] private GameObject newCardNotification;
@@ -62,8 +61,8 @@ namespace AppleHills.UI.CardSystem
ShowOnlyBackpackIcon();
// Hide notifications initially
if (notificationDot != null)
notificationDot.SetActive(false);
if (boosterNotificationDot != null)
boosterNotificationDot.gameObject.SetActive(false);
if (newCardNotification != null)
newCardNotification.SetActive(false);
@@ -154,8 +153,8 @@ namespace AppleHills.UI.CardSystem
_pageController.PushPage(mainMenuPage);
// Clear notification
if (notificationDot != null)
notificationDot.SetActive(false);
if (boosterNotificationDot != null)
boosterNotificationDot.gameObject.SetActive(false);
_hasUnseenCards = false;
}
@@ -269,13 +268,13 @@ namespace AppleHills.UI.CardSystem
/// </summary>
private void UpdateBoosterCount(int count)
{
if (boosterCountText != null)
if (boosterNotificationDot != null)
{
boosterCountText.text = count.ToString();
boosterNotificationDot.SetCount(count);
// Animate the text for feedback
boosterCountText.transform.localScale = Vector3.one * 1.2f;
Tween.LocalScale(boosterCountText.transform, Vector3.one, 0.3f, 0f);
boosterNotificationDot.transform.localScale = Vector3.one * 1.2f;
Tween.LocalScale(boosterNotificationDot.transform, Vector3.one, 0.3f, 0f);
}
}
@@ -299,8 +298,8 @@ namespace AppleHills.UI.CardSystem
_pageController.CurrentPage != boosterOpeningPage)
{
_hasUnseenCards = true;
if (notificationDot != null)
notificationDot.SetActive(true);
if (boosterNotificationDot != null)
boosterNotificationDot.gameObject.SetActive(true);
}
Logging.Debug($"[CardAlbumUI] New card collected: {card.Name}");