diff --git a/popcorn/Assets/MyGame/Scripts/CoinManager.cs b/popcorn/Assets/MyGame/Scripts/CoinManager.cs index db922a8b..de38b455 100644 --- a/popcorn/Assets/MyGame/Scripts/CoinManager.cs +++ b/popcorn/Assets/MyGame/Scripts/CoinManager.cs @@ -17,7 +17,8 @@ public class CoinManager : SingletonMonoBehaviour [SerializeField] private RectTransform coinPrefab; // Animation - [SerializeField] private float duration = 0.5f; + [SerializeField] private float coinUpDuration = 0.5f; + [SerializeField] private float coinMoveDuration = 0.5f; [SerializeField] private RectTransform rootTransform; private int ownCoin; @@ -39,7 +40,7 @@ public class CoinManager : SingletonMonoBehaviour ownCoin += count; coinAnimator.SetTrigger(Add); SoundManager.Instance.PlaySE("se_coin_get"); - coinCountText.CountUpAnimation(coinTextFormat, ownCoin, duration); + coinCountText.CountUpAnimation(coinTextFormat, ownCoin, coinUpDuration); } public void AddCoinWithEffect(int count, Vector3 pos, Action onComplete = null) @@ -47,7 +48,7 @@ public class CoinManager : SingletonMonoBehaviour ownCoin += count; InstantiateEffect(coinPrefab, count, pos, coinIconTransform.position, () => { - coinCountText.CountUpAnimation(coinTextFormat, ownCoin, duration); + coinCountText.CountUpAnimation(coinTextFormat, ownCoin, coinUpDuration); onComplete?.Invoke(); }); } @@ -56,7 +57,7 @@ public class CoinManager : SingletonMonoBehaviour { var coinEffect = Instantiate(prefab, from, Quaternion.identity, rootTransform); var animator = coinEffect.GetComponent(); - this.CallLerp(1f, f => + this.CallLerp(coinMoveDuration, f => { coinEffect.position = Vector3.Lerp(from, to, f * f); }, () => @@ -77,7 +78,7 @@ public class CoinManager : SingletonMonoBehaviour public void SubCoin(int coin){ ownCoin -= coin; if(coinCountText.gameObject.activeInHierarchy){ - coinCountText.CountUpAnimation(coinTextFormat, ownCoin, duration); + coinCountText.CountUpAnimation(coinTextFormat, ownCoin, coinUpDuration); }else{ coinCountText.ChangeValue(coinTextFormat, ownCoin); }