FIxed annoying compiler error
This commit is contained in:
@@ -1,16 +1,14 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.Audio;
|
using UnityEngine.Audio;
|
||||||
using AudioSourceEvents;
|
|
||||||
using System;
|
using System;
|
||||||
using UnityEngine.Events;
|
using UnityEngine.Events;
|
||||||
|
|
||||||
public class NarratorVO : AudioSourceObserver
|
public class NarratorVO : MonoBehaviour
|
||||||
{
|
{
|
||||||
public AudioSource narratorAudioSource;
|
public AudioSource narratorAudioSource;
|
||||||
public AudioResource firstNarration;
|
public AudioResource firstNarration;
|
||||||
public UnityEvent narrationFinished;
|
public UnityEvent narrationFinished;
|
||||||
|
|
||||||
private IAudioEventSource _eventSource;
|
|
||||||
|
|
||||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||||
void Start()
|
void Start()
|
||||||
@@ -20,8 +18,6 @@ public class NarratorVO : AudioSourceObserver
|
|||||||
|
|
||||||
void PlayNarrationAudio()
|
void PlayNarrationAudio()
|
||||||
{
|
{
|
||||||
_eventSource = narratorAudioSource.RequestEventHandlers();
|
|
||||||
_eventSource.AudioStopped += NarrationFinished;
|
|
||||||
|
|
||||||
narratorAudioSource.resource = firstNarration;
|
narratorAudioSource.resource = firstNarration;
|
||||||
narratorAudioSource.Play();
|
narratorAudioSource.Play();
|
||||||
|
|||||||
Reference in New Issue
Block a user