From 5e3a864fcf5552c195b1d2668f49a125a4bbe838 Mon Sep 17 00:00:00 2001 From: kimura Date: Mon, 30 Aug 2021 12:00:56 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=8F=E3=83=BC=E3=83=88=E3=82=A2=E3=83=8B?= =?UTF-8?q?=E3=83=A1=E3=83=BC=E3=82=B7=E3=83=A7=E3=83=B3callback=E5=AF=BE?= =?UTF-8?q?=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MyGame/Scenes/marketing/Scripts/HeartAnimation.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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); + }); }); }); });