Stash work!

This commit is contained in:
Michal Pikulski
2025-11-17 17:10:24 +01:00
parent c6f635f871
commit b5364a2bbc
29 changed files with 665 additions and 2444 deletions

View File

@@ -75,6 +75,7 @@ namespace AppleHills.Editor
CardSystemManager.Instance.OnCardCollected += OnCardCollected;
CardSystemManager.Instance.OnBoosterCountChanged += OnBoosterCountChanged;
CardSystemManager.Instance.OnPendingCardAdded += OnPendingCardAdded;
CardSystemManager.Instance.OnPendingCardRemoved += OnPendingCardRemoved;
isSubscribed = true;
Debug.Log("[CardSystemLivePreview] Subscribed to CardSystemManager events");
@@ -91,6 +92,7 @@ namespace AppleHills.Editor
CardSystemManager.Instance.OnCardCollected -= OnCardCollected;
CardSystemManager.Instance.OnBoosterCountChanged -= OnBoosterCountChanged;
CardSystemManager.Instance.OnPendingCardAdded -= OnPendingCardAdded;
CardSystemManager.Instance.OnPendingCardRemoved -= OnPendingCardRemoved;
}
isSubscribed = false;
@@ -125,6 +127,13 @@ namespace AppleHills.Editor
Repaint();
}
private void OnPendingCardRemoved(CardData card)
{
lastEventMessage = $"Card removed from pending: {card.Name} ({card.Rarity}) - being placed";
RefreshData();
Repaint();
}
private void RefreshData()
{
if (!Application.isPlaying || CardSystemManager.Instance == null) return;