From 6b1dc45ba69c33223e656ec8356358faef2e282c Mon Sep 17 00:00:00 2001 From: Rapandrasmus <78219215+Rapandrasmus@users.noreply.github.com> Date: Fri, 23 Jun 2023 18:51:18 +0200 Subject: [PATCH] Fixed kick sound being weird --- Assets/Scripts/Games/NightWalkAgb/AgbPlatform.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Assets/Scripts/Games/NightWalkAgb/AgbPlatform.cs b/Assets/Scripts/Games/NightWalkAgb/AgbPlatform.cs index 50e2e299b..6676be73b 100644 --- a/Assets/Scripts/Games/NightWalkAgb/AgbPlatform.cs +++ b/Assets/Scripts/Games/NightWalkAgb/AgbPlatform.cs @@ -122,11 +122,17 @@ namespace HeavenStudio.Games.Scripts_AgbNightWalk } if (nextPlatformIsSameHeight) { - kickSound = SoundByte.PlayOneShotGame("nightWalkAgb/boxKick", endBeat); canKick = true; BeatAction.New(gameObject, new List() { - new BeatAction.Action(endBeat, delegate { if (canKick && !stopped) anim.Play("Kick", 0, 0); }) + new BeatAction.Action(endBeat, delegate + { + if (canKick && !stopped) + { + SoundByte.PlayOneShotGame("nightWalkAgb/boxKick"); + anim.Play("Kick", 0, 0); + } + }) }); } @@ -172,7 +178,6 @@ namespace HeavenStudio.Games.Scripts_AgbNightWalk { stopped = true; if (inputEvent != null) inputEvent.Disable(); - if (kickSound != null) kickSound.Delete(); } public void Disappear(double beat)