Working bottom-corner card display
This commit is contained in:
@@ -163,6 +163,25 @@ namespace UI.CardSystem.StateMachine
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update card data without re-capturing original transform values.
|
||||
/// Use this when assigning data to an already-initialized card (e.g., pending cards on drag).
|
||||
/// This prevents changing OriginalScale when the card is already correctly sized.
|
||||
/// </summary>
|
||||
public void UpdateCardData(CardData data)
|
||||
{
|
||||
cardData = data;
|
||||
_hasCompletedReveal = false; // Reset completion flag
|
||||
|
||||
// Don't re-capture OriginalScale/Position/Rotation
|
||||
// This preserves the transform values captured during initial setup
|
||||
|
||||
if (cardDisplay != null)
|
||||
{
|
||||
cardDisplay.SetupCard(data);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the card display component
|
||||
/// </summary>
|
||||
|
||||
@@ -32,6 +32,9 @@ namespace UI.CardSystem.StateMachine.States
|
||||
_targetSlot = null;
|
||||
_dragEndedDuringFlip = false;
|
||||
|
||||
// Reset scale to normal (in case transitioning from scaled state)
|
||||
_context.RootTransform.localScale = Vector3.one;
|
||||
|
||||
// Show card back, hide card front
|
||||
if (cardBackVisual != null)
|
||||
{
|
||||
@@ -70,7 +73,9 @@ namespace UI.CardSystem.StateMachine.States
|
||||
}
|
||||
|
||||
// Step 3: Apply card data to context
|
||||
context.SetupCard(cardData);
|
||||
// Use UpdateCardData instead of SetupCard to preserve OriginalScale
|
||||
// (card was already initialized with correct scale in SpawnCardInSlot)
|
||||
context.UpdateCardData(cardData);
|
||||
Logging.Debug($"[CardPendingFaceDownState] Assigned card data: {cardData.Name} ({cardData.Zone})");
|
||||
|
||||
// Step 4: Ask AlbumViewPage for target slot
|
||||
|
||||
Reference in New Issue
Block a user