More sounds
This commit is contained in:
@@ -12,6 +12,9 @@ public class SoundManager : UdonSharpBehaviour
|
||||
[SerializeField] private AudioClip pacStart;
|
||||
[SerializeField] private AudioClip pacDot1;
|
||||
[SerializeField] private AudioClip pacDot2;
|
||||
[SerializeField] private AudioClip pacFruit;
|
||||
[SerializeField] private AudioClip pacCoin;
|
||||
[SerializeField] private AudioClip pacGhostEat;
|
||||
[SerializeField] private AudioClip pacGhost1;
|
||||
|
||||
private AudioClip nextDotSound;
|
||||
@@ -32,11 +35,32 @@ public class SoundManager : UdonSharpBehaviour
|
||||
nextDotSound = nextDotSound == pacDot1 ? pacDot2 : pacDot1;
|
||||
}
|
||||
|
||||
public void PlayFruitSound()
|
||||
{
|
||||
PlaySound(audioSourcePlayer, pacFruit);
|
||||
}
|
||||
|
||||
public void PlayCoinSound()
|
||||
{
|
||||
PlaySound(audioSourcePlayer, pacCoin);
|
||||
}
|
||||
|
||||
public void PlayGhostEatSound()
|
||||
{
|
||||
PlaySound(audioSourcePlayer, pacGhostEat);
|
||||
}
|
||||
|
||||
public void StartGhostSound()
|
||||
{
|
||||
PlaySound(audioSourceGhosts, pacGhost1, true);
|
||||
}
|
||||
|
||||
public void StopAllSound()
|
||||
{
|
||||
audioSourcePlayer.Stop();
|
||||
audioSourceGhosts.Stop();
|
||||
}
|
||||
|
||||
private void PlaySound(AudioSource audioSource, AudioClip audioClip, bool loop = false)
|
||||
{
|
||||
audioSource.clip = audioClip;
|
||||
|
||||
Reference in New Issue
Block a user