Properly queue critical VO clips
This commit is contained in:
@@ -8,8 +8,8 @@ using UnityEngine.Audio;
|
||||
public class BushAudioController : MonoBehaviour
|
||||
{
|
||||
private IAudioEventSource _eventSource;
|
||||
public AudioSource VOPlayer;
|
||||
public AudioSource SFXPlayer;
|
||||
public AppleAudioSource VOPlayer;
|
||||
public AppleAudioSource SFXPlayer;
|
||||
public AudioResource reactionClipToPlay;
|
||||
public AudioResource flashSFXClipToPlay;
|
||||
|
||||
@@ -22,28 +22,28 @@ public class BushAudioController : MonoBehaviour
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
_eventSource = VOPlayer.RequestEventHandlers();
|
||||
_eventSource = VOPlayer.audioSource.RequestEventHandlers();
|
||||
_eventSource.AudioStopped += PlayBirdCounter;
|
||||
|
||||
}
|
||||
|
||||
public void PlayPhotoSoundBite()
|
||||
{
|
||||
VOPlayer.resource = reactionClipToPlay;
|
||||
VOPlayer.Play();
|
||||
VOPlayer.audioSource.resource = reactionClipToPlay;
|
||||
VOPlayer.Play(0);
|
||||
}
|
||||
|
||||
public void PlayFlashSound()
|
||||
{
|
||||
SFXPlayer.resource = flashSFXClipToPlay;
|
||||
SFXPlayer.Play();
|
||||
SFXPlayer.audioSource.resource = flashSFXClipToPlay;
|
||||
SFXPlayer.Play(0);
|
||||
}
|
||||
|
||||
private void PlayBirdCounter(object sender, EventArgs e)
|
||||
{
|
||||
_eventSource.AudioStopped -= PlayBirdCounter;
|
||||
VOPlayer.resource = birdCounterClip[birdGameStats.birdsFoundInLevel];
|
||||
VOPlayer.Play();
|
||||
VOPlayer.audioSource.resource = birdCounterClip[birdGameStats.birdsFoundInLevel];
|
||||
VOPlayer.Play(0);
|
||||
birdGameStats.BirdFound();
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user