Add a semi-finished booster opening sequence

This commit is contained in:
Michal Pikulski
2025-11-06 15:27:05 +01:00
parent 4e0c9cb4c4
commit 2d10d92bf5
11 changed files with 5540 additions and 100 deletions

View File

@@ -195,12 +195,29 @@ namespace UI.CardSystem
_currentBoosterInCenter = booster;
// Lock the slot so it can't be dragged out
// Lock the slot so it can't be dragged out
centerOpeningSlot.SetLocked(true);
// Enable tap-to-open and reset tap count
booster.ResetTapCount();
booster.SetTapToOpenEnabled(true);
// Configure booster for opening (disables drag, enables tapping, resets tap count)
booster.SetInOpeningSlot(true);
// Subscribe to tap events for visual feedback
booster.OnTapped += OnBoosterTapped;
booster.OnReadyToOpen += OnBoosterReadyToOpen;
Debug.Log($"[BoosterOpeningPage] Booster placed in center, ready for {booster.CurrentTapCount} taps");
}
private void OnBoosterTapped(BoosterPackDraggable booster, int currentTaps, int maxTaps)
{
Debug.Log($"[BoosterOpeningPage] Booster tapped: {currentTaps}/{maxTaps}");
// Calculate shake intensity (increases with each tap)
float shakeIntensity = currentTaps / (float)maxTaps;
float shakeAmount = 10f + (shakeIntensity * 30f); // 10 to 40 units
// TODO: Shake visual feedback
// This would be handled by BoosterPackVisual if we add a shake method
}
/// <summary>
@@ -222,6 +239,10 @@ namespace UI.CardSystem
{
if (_isProcessingOpening) return;
Debug.Log($"[BoosterOpeningPage] Booster ready to open!");
// Trigger the actual opening sequence
booster.TriggerOpen();
StartCoroutine(ProcessBoosterOpening(booster));
}