coinmanager修正

This commit is contained in:
kimura 2021-10-08 18:37:39 +09:00
parent 652caebb32
commit 20079e7fab
1 changed files with 2 additions and 2 deletions

View File

@ -40,7 +40,7 @@ public class CoinManager : SingletonMonoBehaviour<CoinManager>
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<CoinManager>
InstantiateEffeect(coinPrefab, count, Vector3.zero, coinIconTransform.position, () =>
{
coinCountText.CountUpAnimation(coinTextFormat, ownCoin, duration);
callback.Invoke();
callback?.Invoke();
});
}