From 20079e7fab718073ad8c9814e8af2f494e174c4b Mon Sep 17 00:00:00 2001 From: kimura Date: Fri, 8 Oct 2021 18:37:39 +0900 Subject: [PATCH] =?UTF-8?q?coinmanager=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- popcorn/Assets/MyGame/Scripts/CoinManager.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/popcorn/Assets/MyGame/Scripts/CoinManager.cs b/popcorn/Assets/MyGame/Scripts/CoinManager.cs index d925aa9a..dd1c5c75 100644 --- a/popcorn/Assets/MyGame/Scripts/CoinManager.cs +++ b/popcorn/Assets/MyGame/Scripts/CoinManager.cs @@ -40,7 +40,7 @@ public class CoinManager : SingletonMonoBehaviour coinCountText.CountUpAnimation(coinTextFormat, ownCoin, duration); } - public void AddCoinWithEffect(int count, Action callback) + public void AddCoinWithEffect(int count, Action callback = null) { ownCoin += count; // 生成枚数決定 @@ -48,7 +48,7 @@ public class CoinManager : SingletonMonoBehaviour InstantiateEffeect(coinPrefab, count, Vector3.zero, coinIconTransform.position, () => { coinCountText.CountUpAnimation(coinTextFormat, ownCoin, duration); - callback.Invoke(); + callback?.Invoke(); }); }