This commit is contained in:
BOT Alex 2024-04-21 03:21:27 +02:00
commit 23d2a439c4
1 changed files with 4 additions and 2 deletions

View File

@ -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()