From 02156234013fc7cfeaeffa2d318795ba93ee2f7e Mon Sep 17 00:00:00 2001 From: kimura Date: Thu, 25 Nov 2021 10:23:23 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=B3=E3=82=A4=E3=83=B3=E5=90=B8=E5=8F=8E?= =?UTF-8?q?=E6=99=82=E9=96=93=E3=82=92=E8=A8=AD=E5=AE=9A=E5=8F=AF=E8=83=BD?= =?UTF-8?q?=E3=81=AB=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- popcorn/Assets/MyGame/Scripts/CoinManager.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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); }