Make cards use settings

This commit is contained in:
Michal Pikulski
2025-11-12 09:24:27 +01:00
committed by Michal Pikulski
parent 4fdbbb0aa8
commit a6471ede45
15 changed files with 232 additions and 69 deletions

View File

@@ -1,7 +1,7 @@
using Core.SaveLoad;
using UnityEngine;
using UnityEngine.EventSystems;
using Core;
using AppleHills.Core.Settings;
namespace UI.CardSystem.StateMachine.States
{
@@ -11,16 +11,15 @@ namespace UI.CardSystem.StateMachine.States
/// </summary>
public class CardDraggingState : AppleState
{
[Header("Drag Settings")]
[SerializeField] private float dragScale = 1.1f;
private CardContext _context;
private ICardSystemSettings _settings;
private Vector3 _originalScale;
private Vector3 _dragStartPosition;
private void Awake()
{
_context = GetComponentInParent<CardContext>();
_settings = GameManager.GetSettingsObject<ICardSystemSettings>();
}
public override void OnEnterState()
@@ -30,7 +29,7 @@ namespace UI.CardSystem.StateMachine.States
_dragStartPosition = _context.RootTransform.position;
// Scale up slightly during drag for visual feedback
_context.RootTransform.localScale = _originalScale * dragScale;
_context.RootTransform.localScale = _originalScale * _settings.DragScale;
Logging.Debug($"[CardDraggingState] Entered drag state for card: {_context.CardData?.Name}");
}