Make cards use settings
This commit is contained in:
committed by
Michal Pikulski
parent
4fdbbb0aa8
commit
a6471ede45
@@ -2,7 +2,7 @@
|
||||
using Core.SaveLoad;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
using UI.CardSystem.StateMachine;
|
||||
using AppleHills.Core.Settings;
|
||||
|
||||
namespace UI.CardSystem.StateMachine.States
|
||||
{
|
||||
@@ -13,6 +13,7 @@ namespace UI.CardSystem.StateMachine.States
|
||||
public class CardAlbumEnlargedState : AppleState, IPointerClickHandler
|
||||
{
|
||||
private CardContext _context;
|
||||
private ICardSystemSettings _settings;
|
||||
private Vector3 _originalScale;
|
||||
private Transform _originalParent;
|
||||
private Vector3 _originalLocalPosition;
|
||||
@@ -25,6 +26,7 @@ namespace UI.CardSystem.StateMachine.States
|
||||
private void Awake()
|
||||
{
|
||||
_context = GetComponentInParent<CardContext>();
|
||||
_settings = GameManager.GetSettingsObject<ICardSystemSettings>();
|
||||
}
|
||||
|
||||
public override void OnEnterState()
|
||||
@@ -38,10 +40,10 @@ namespace UI.CardSystem.StateMachine.States
|
||||
// Notify page to show backdrop and reparent card to top layer
|
||||
OnEnlargeRequested?.Invoke(this);
|
||||
|
||||
// Enlarge the card
|
||||
// Enlarge the card using album scale setting
|
||||
if (_context.Animator != null)
|
||||
{
|
||||
_context.Animator.PlayEnlarge();
|
||||
_context.Animator.PlayEnlarge(_settings.AlbumCardEnlargedScale);
|
||||
}
|
||||
|
||||
Logging.Debug($"[CardAlbumEnlargedState] Card enlarged from album: {_context.CardData?.Name}");
|
||||
|
||||
Reference in New Issue
Block a user