WOrking card dragging, slotting, previewing
This commit is contained in:
@@ -695,6 +695,52 @@ namespace UI.CardSystem
|
||||
Debug.Log($"[AlbumViewPage] Card shrunk: {card.GetCardData()?.Name}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Show backdrop and reparent slot preview card for enlargement
|
||||
/// </summary>
|
||||
public void ShowSlotPreview(AlbumCardSlot slot, Transform previewCardTransform)
|
||||
{
|
||||
if (previewCardTransform == null)
|
||||
return;
|
||||
|
||||
Debug.Log($"[AlbumViewPage] ShowSlotPreview called for slot: {slot.name}");
|
||||
|
||||
// Show backdrop
|
||||
if (cardEnlargedBackdrop != null)
|
||||
{
|
||||
cardEnlargedBackdrop.SetActive(true);
|
||||
}
|
||||
|
||||
// Reparent preview card to enlarged container (above backdrop)
|
||||
if (cardEnlargedContainer != null)
|
||||
{
|
||||
previewCardTransform.SetParent(cardEnlargedContainer, true);
|
||||
previewCardTransform.SetAsLastSibling();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Hide backdrop and trigger shrink animation for slot preview
|
||||
/// </summary>
|
||||
public void HideSlotPreview(AlbumCardSlot slot, Transform previewCardTransform, System.Action onComplete)
|
||||
{
|
||||
if (previewCardTransform == null)
|
||||
return;
|
||||
|
||||
Debug.Log($"[AlbumViewPage] HideSlotPreview called for slot: {slot.name}");
|
||||
|
||||
// Hide backdrop
|
||||
if (cardEnlargedBackdrop != null)
|
||||
{
|
||||
cardEnlargedBackdrop.SetActive(false);
|
||||
}
|
||||
|
||||
// Shrink preview card
|
||||
Vector3 originalScale = previewCardTransform.localScale / 2.5f; // Assuming 2.5x is enlarged scale
|
||||
Pixelplacement.Tween.LocalScale(previewCardTransform, originalScale, 0.3f, 0f, Pixelplacement.Tween.EaseInBack,
|
||||
completeCallback: () => onComplete?.Invoke());
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user