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)
|
||||
|
||||
@@ -7,6 +7,7 @@ using Input;
|
||||
using Minigames.CardSorting.Controllers;
|
||||
using Unity.Cinemachine;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Audio;
|
||||
|
||||
namespace Minigames.CardSorting.Core
|
||||
{
|
||||
@@ -72,6 +73,10 @@ namespace Minigames.CardSorting.Core
|
||||
public event Action<SortableItem> OnItemSortedCorrectly;
|
||||
public event Action<SortableItem> OnItemSortedIncorrectly;
|
||||
public event Action<SortableItem> OnItemFellOffBelt;
|
||||
|
||||
// Sound effects
|
||||
public AppleAudioSource audioSource;
|
||||
public AudioResource introAudio;
|
||||
|
||||
internal override void OnManagedAwake()
|
||||
{
|
||||
@@ -194,6 +199,10 @@ namespace Minigames.CardSorting.Core
|
||||
}
|
||||
|
||||
Logging.Debug("[SortingGameManager] Game started!");
|
||||
audioSource.audioSource.resource = introAudio;
|
||||
audioSource.Play(0);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -46,6 +46,8 @@ namespace Minigames.StatueDressup.Controllers
|
||||
// Public properties
|
||||
public Transform StatueParent => statueParent;
|
||||
public RectTransform StatueArea => statueArea;
|
||||
|
||||
public DressupPhotoFeedback dressupFeedback;
|
||||
|
||||
internal override void OnManagedAwake()
|
||||
{
|
||||
@@ -167,6 +169,7 @@ namespace Minigames.StatueDressup.Controllers
|
||||
}
|
||||
|
||||
Logging.Debug("[StatueDecorationController] Taking photo of statue");
|
||||
dressupFeedback.PhotoTaken();
|
||||
|
||||
// CapturePhotoCoroutine handles all UI hiding/showing
|
||||
StartCoroutine(CapturePhotoCoroutine());
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.Audio;
|
||||
|
||||
public class DressupPhotoFeedback : MonoBehaviour
|
||||
{
|
||||
public AppleAudioSource voiceAudioSource;
|
||||
public AppleAudioSource SoundAudioSource;
|
||||
public AudioResource takePhotoAudioVO;
|
||||
public AudioResource takePhotoAudioSFX;
|
||||
|
||||
public void PhotoTaken()
|
||||
{
|
||||
voiceAudioSource.audioSource.resource = takePhotoAudioVO;
|
||||
voiceAudioSource.Play(0);
|
||||
SoundAudioSource.audioSource.resource = takePhotoAudioSFX;
|
||||
SoundAudioSource.Play(0);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 37f543020dc5c93449845aad96e4da6c
|
||||
Reference in New Issue
Block a user