More snappy tap animation
This commit is contained in:
@@ -134,16 +134,47 @@ namespace UI.CardSystem.DragDrop
|
||||
/// </summary>
|
||||
public void SetInOpeningSlot(bool inSlot)
|
||||
{
|
||||
Debug.Log($"[BoosterPackDraggable] SetInOpeningSlot({inSlot}) called on {name}");
|
||||
|
||||
SetDraggingEnabled(!inSlot); // Disable dragging when in opening slot
|
||||
Debug.Log($"[BoosterPackDraggable] SetDraggingEnabled({!inSlot}) called");
|
||||
|
||||
canTapToOpen = inSlot; // Enable tap-to-open when in opening slot
|
||||
|
||||
if (inSlot)
|
||||
{
|
||||
_currentTapCount = 0; // Reset tap counter when placed
|
||||
|
||||
// Suppress visual effects (idle animations, glow, etc.) when in opening slot
|
||||
// But allow slot tween and tap pulse to still work
|
||||
if (Visual != null)
|
||||
{
|
||||
Visual.SuppressEffects();
|
||||
|
||||
// Play one-time placement tween to animate into slot
|
||||
// The visual will follow the parent to its slot position, then lock in place
|
||||
// Get target scale from current slot if it has scale mode
|
||||
Vector3 targetScale = Vector3.one;
|
||||
if (CurrentSlot != null && CurrentSlot.GetComponent<DraggableSlot>() != null)
|
||||
{
|
||||
// Access the slot's occupant scale if it's in Scale mode
|
||||
// For now, use Vector3.one as default
|
||||
targetScale = Vector3.one;
|
||||
}
|
||||
|
||||
Visual.PlayPlacementTween(0.3f, targetScale);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ResetOpeningState(); // Reset completely when removed
|
||||
|
||||
// Resume visual effects when removed from opening slot
|
||||
if (Visual != null)
|
||||
{
|
||||
Visual.StopPlacementTween(); // Stop any ongoing placement tween
|
||||
Visual.ResumeEffects();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user