Merge branch 'main' of https://gitea.deprived.dev/Sveskejuice/3DTD
This commit is contained in:
commit
23d2a439c4
|
@ -16,6 +16,7 @@ public class GravityTower : Tower
|
||||||
|
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
private string audioName;
|
private string audioName;
|
||||||
|
private AudioSource audioSc;
|
||||||
|
|
||||||
public override void TowerSelected(bool selected)
|
public override void TowerSelected(bool selected)
|
||||||
{
|
{
|
||||||
|
@ -33,8 +34,7 @@ public class GravityTower : Tower
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(audioName))
|
if (!string.IsNullOrEmpty(audioName))
|
||||||
{
|
{
|
||||||
Debug.Log("play");
|
audioSc = AudioManager.PlaySound(audioName, transform.position, false, true, true);
|
||||||
AudioManager.PlaySound(audioName, transform.position);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,6 +53,8 @@ public class GravityTower : Tower
|
||||||
protected override void OnDestroy()
|
protected override void OnDestroy()
|
||||||
{
|
{
|
||||||
base.OnDestroy();
|
base.OnDestroy();
|
||||||
|
|
||||||
|
audioSc.Stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Update()
|
protected override void Update()
|
||||||
|
|
Loading…
Reference in New Issue