AnneLise bird counter implemented

This commit is contained in:
2025-10-20 13:57:38 +02:00
parent 6e5a6c049f
commit b49bb43f79
22 changed files with 520 additions and 11 deletions

View File

@@ -0,0 +1,15 @@
using UnityEngine;
public class AnneLiseMain : MonoBehaviour
{
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
}
void PlayIntroVO()
{
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: f8fad2d7a81d63b45aad87edfd322669

View File

@@ -0,0 +1,16 @@
using UnityEngine;
public class AudioManager : MonoBehaviour
{
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: d8bd90cfc02c8274fac5ce090285ed6a

View File

@@ -0,0 +1,55 @@
using AudioSourceEvents;
using Input;
using System;
using System.Diagnostics.Tracing;
using UnityEngine;
using UnityEngine.Audio;
public class BushAudioController : MonoBehaviour
{
private IAudioEventSource _eventSource;
public AudioSource VOPlayer;
public AudioSource SFXPlayer;
public AudioResource reactionClipToPlay;
public AudioResource flashSFXClipToPlay;
public BirdGameStats birdGameStats;
public AudioResource[] birdCounterClip;
private int _birdCounter;
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
_eventSource = VOPlayer.RequestEventHandlers();
_eventSource.AudioStopped += PlayBirdCounter;
}
public void PlayPhotoSoundBite()
{
VOPlayer.resource = reactionClipToPlay;
VOPlayer.Play();
}
public void PlayFlashSound()
{
SFXPlayer.resource = flashSFXClipToPlay;
SFXPlayer.Play();
}
private void PlayBirdCounter(object sender, EventArgs e)
{
VOPlayer.resource = birdCounterClip[birdGameStats.birdsFoundInLevel];
VOPlayer.Play();
birdGameStats.BirdFound();
_eventSource.AudioStopped -= PlayBirdCounter;
}
public void OnDisable()
{
// Unsubscribe from events when disabled
_eventSource.AudioStopped -= PlayBirdCounter;
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: edc43a9f07fedb44abb68b06c71d17ea

View File

@@ -0,0 +1,35 @@
using UnityEngine;
using UnityEngine.Audio;
using AudioSourceEvents;
using System;
using UnityEngine.Events;
public class NarratorVO : AudioSourceObserver
{
public AudioSource narratorAudioSource;
public AudioResource firstNarration;
public UnityEvent narrationFinished;
private IAudioEventSource _eventSource;
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
PlayNarrationAudio();
}
void PlayNarrationAudio()
{
_eventSource = narratorAudioSource.RequestEventHandlers();
_eventSource.AudioStopped += NarrationFinished;
narratorAudioSource.resource = firstNarration;
narratorAudioSource.Play();
}
private void NarrationFinished(object sender, EventArgs e)
{
narrationFinished.Invoke();
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: cb5c6632b7606ce43a0b2dbf11215dc8