Minigame audio and intros p1
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using UnityEngine;
|
||||
using Core.Lifecycle;
|
||||
using UnityEngine.Audio;
|
||||
|
||||
namespace Minigames.BirdPooper
|
||||
{
|
||||
@@ -32,6 +33,12 @@ namespace Minigames.BirdPooper
|
||||
// timestamp of last poop spawn
|
||||
private float _lastPoopTime = -Mathf.Infinity;
|
||||
|
||||
// Audio stuff
|
||||
public bool firstTimePlaying;
|
||||
public AppleAudioSource audioSource;
|
||||
public AudioResource poopingIntro;
|
||||
public AudioResource poopingOutro;
|
||||
|
||||
internal override void OnManagedAwake()
|
||||
{
|
||||
base.OnManagedAwake();
|
||||
@@ -109,6 +116,12 @@ namespace Minigames.BirdPooper
|
||||
/// </summary>
|
||||
public void BeginMinigame()
|
||||
{
|
||||
if (firstTimePlaying)
|
||||
{
|
||||
audioSource.audioSource.resource = poopingIntro;
|
||||
audioSource.Play(0);
|
||||
firstTimePlaying = false;
|
||||
}
|
||||
// Initialize game state
|
||||
_isGameOver = false;
|
||||
_targetsHit = 0;
|
||||
@@ -181,6 +194,9 @@ namespace Minigames.BirdPooper
|
||||
|
||||
_isGameOver = true;
|
||||
Debug.Log($"[BirdPooperGameManager] Player damaged - Game Over! Targets Hit: {_targetsHit}");
|
||||
|
||||
audioSource.audioSource.resource = poopingOutro;
|
||||
audioSource.Play(0);
|
||||
|
||||
// Stop spawning obstacles
|
||||
if (obstacleSpawner != null)
|
||||
|
||||
Reference in New Issue
Block a user