Update assets, working save kerfuffle
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
using Core.SaveLoad;
|
||||
using Core;
|
||||
using Core.SaveLoad;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UI.CardSystem.StateMachine.States
|
||||
{
|
||||
/// <summary>
|
||||
/// Card is in pending face-down state in corner, awaiting drag.
|
||||
/// On drag start, triggers data assignment, flip animation, and page navigation.
|
||||
/// On drag start, triggers flip animation and transitions to revealed dragging.
|
||||
/// </summary>
|
||||
public class CardPendingFaceDownState : AppleState
|
||||
public class CardPendingFaceDownState : AppleState, ICardStateDragHandler
|
||||
{
|
||||
[Header("State-Owned Visuals")]
|
||||
[SerializeField] private GameObject cardBackVisual;
|
||||
@@ -44,15 +45,31 @@ namespace UI.CardSystem.StateMachine.States
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called by Card.OnDragStartedHook when user starts dragging.
|
||||
/// This triggers the smart selection, page navigation, and flip animation.
|
||||
/// Handle drag start - triggers flip animation and page navigation
|
||||
/// </summary>
|
||||
public void OnDragStarted()
|
||||
public bool OnCardDragStarted(CardContext context)
|
||||
{
|
||||
if (_isFlipping) return; // Already flipping
|
||||
if (_isFlipping) return true; // Already handling
|
||||
|
||||
// Start flip animation (data should be assigned by listeners by now)
|
||||
// IMPORTANT: Data must be assigned by event listeners (AlbumViewPage) BEFORE we flip
|
||||
// The event system guarantees this because events are synchronous
|
||||
if (context.CardData == null)
|
||||
{
|
||||
Logging.Warning("[CardPendingFaceDownState] OnCardDragStarted called but no CardData assigned yet!");
|
||||
return true; // Don't flip without data
|
||||
}
|
||||
|
||||
// Start flip animation (data is now guaranteed to be assigned)
|
||||
StartFlipAnimation();
|
||||
return true; // We handled it, prevent default DraggingState transition
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// We don't handle drag end in face-down state
|
||||
/// </summary>
|
||||
public bool OnCardDragEnded(CardContext context)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
private void StartFlipAnimation()
|
||||
|
||||
Reference in New Issue
Block a user