40 lines
1.2 KiB
C#
40 lines
1.2 KiB
C#
using Core.SaveLoad;
|
|
using UnityEngine;
|
|
|
|
namespace UI.CardSystem.StateMachine.States
|
|
{
|
|
/// <summary>
|
|
/// Card is in pending face-down state in corner, awaiting drag.
|
|
/// Front hidden, back visible (assumes CardBack child exists).
|
|
/// </summary>
|
|
public class CardPendingFaceDownState : AppleState
|
|
{
|
|
private CardContext context;
|
|
private GameObject cardBack;
|
|
|
|
private void Awake()
|
|
{
|
|
context = GetComponentInParent<CardContext>();
|
|
if (context != null)
|
|
{
|
|
var backTransform = context.RootTransform.Find("CardBack");
|
|
if (backTransform != null) cardBack = backTransform.gameObject;
|
|
}
|
|
}
|
|
|
|
public override void OnEnterState()
|
|
{
|
|
if (context == null) return;
|
|
// Hide front
|
|
if (context.CardDisplay != null)
|
|
{
|
|
context.CardDisplay.gameObject.SetActive(false);
|
|
}
|
|
// Show back
|
|
if (cardBack != null) cardBack.SetActive(true);
|
|
// Scale
|
|
context.RootTransform.localScale = context.OriginalScale * 0.8f;
|
|
}
|
|
}
|
|
}
|