From dfd199f101565b84f5d1590484d4c83eb1696f31 Mon Sep 17 00:00:00 2001 From: Sveske Juice Date: Sun, 21 Apr 2024 03:10:37 +0200 Subject: [PATCH] black hole sfx done --- Assets/Scripts/Tower/GravityTower.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/Tower/GravityTower.cs b/Assets/Scripts/Tower/GravityTower.cs index a024b49..4f87ed0 100644 --- a/Assets/Scripts/Tower/GravityTower.cs +++ b/Assets/Scripts/Tower/GravityTower.cs @@ -16,6 +16,7 @@ public class GravityTower : Tower [SerializeField] private string audioName; + private AudioSource audioSc; public override void TowerSelected(bool selected) { @@ -33,8 +34,7 @@ public class GravityTower : Tower if (!string.IsNullOrEmpty(audioName)) { - Debug.Log("play"); - AudioManager.PlaySound(audioName, transform.position); + audioSc = AudioManager.PlaySound(audioName, transform.position, false, true, true); } } @@ -53,6 +53,8 @@ public class GravityTower : Tower protected override void OnDestroy() { base.OnDestroy(); + + audioSc.Stop(); } protected override void Update()