Almost working card state machine
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
using Core;
|
||||
using Core.SaveLoad;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
|
||||
namespace UI.CardSystem.StateMachine.States
|
||||
{
|
||||
@@ -9,7 +8,7 @@ namespace UI.CardSystem.StateMachine.States
|
||||
/// Placed in slot state - card is in an album slot and can be clicked to enlarge.
|
||||
/// Manages the parent slot reference.
|
||||
/// </summary>
|
||||
public class CardPlacedInSlotState : AppleState, IPointerClickHandler
|
||||
public class CardPlacedInSlotState : AppleState, ICardClickHandler
|
||||
{
|
||||
private CardContext _context;
|
||||
private AlbumCardSlot _parentSlot;
|
||||
@@ -51,11 +50,11 @@ namespace UI.CardSystem.StateMachine.States
|
||||
return _parentSlot;
|
||||
}
|
||||
|
||||
public void OnPointerClick(PointerEventData eventData)
|
||||
public void OnCardClicked(CardContext context)
|
||||
{
|
||||
// Click to enlarge when in album
|
||||
Logging.Debug($"[CardPlacedInSlotState] Card clicked in slot, transitioning to enlarged state");
|
||||
_context.StateMachine.ChangeState("AlbumEnlargedState");
|
||||
context.StateMachine.ChangeState("AlbumEnlargedState");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user