2025-10-17 14:38:42 +02:00
|
|
|
using UnityEngine;
|
|
|
|
|
using UnityEngine.Audio;
|
|
|
|
|
using System;
|
|
|
|
|
using UnityEngine.Events;
|
|
|
|
|
|
2025-10-21 13:37:14 +02:00
|
|
|
public class NarratorVO : MonoBehaviour
|
2025-10-17 14:38:42 +02:00
|
|
|
{
|
|
|
|
|
public AudioSource narratorAudioSource;
|
|
|
|
|
public AudioResource firstNarration;
|
|
|
|
|
public UnityEvent narrationFinished;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
|
|
|
|
void Start()
|
|
|
|
|
{
|
|
|
|
|
PlayNarrationAudio();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void PlayNarrationAudio()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
narratorAudioSource.resource = firstNarration;
|
|
|
|
|
narratorAudioSource.Play();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void NarrationFinished(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
narrationFinished.Invoke();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|