diff --git a/popcorn/Assets/MyGame/Scenes/marketing/Scripts/HeartAnimation.cs b/popcorn/Assets/MyGame/Scenes/marketing/Scripts/HeartAnimation.cs index 5209d9c0..81e48637 100644 --- a/popcorn/Assets/MyGame/Scenes/marketing/Scripts/HeartAnimation.cs +++ b/popcorn/Assets/MyGame/Scenes/marketing/Scripts/HeartAnimation.cs @@ -1,3 +1,4 @@ +using System; using UnityEngine; public class HeartAnimation : MonoBehaviour @@ -8,8 +9,7 @@ public class HeartAnimation : MonoBehaviour private float animationDelay = .3f; private float animationDuration = .8f; private float heartToMeterDuration = .5f; - private float destroyDeley = 2f; - public void GetHeart() + public void GetHeart(Action callback = null) { smallHeart.SetActive(false); this.CallWaitForSeconds(animationDelay, () => @@ -26,7 +26,11 @@ public class HeartAnimation : MonoBehaviour }, () => { smallHeart.SetActive(true); - Destroy(bigHeart, destroyDeley); + this.CallWaitForSeconds(1f, () => + { + callback?.Invoke(); + Destroy(bigHeart, 1f); + }); }); }); });