Dump VO done
This commit is contained in:
@@ -7,6 +7,7 @@ using Minigames.TrashMaze.Core;
|
||||
using Minigames.TrashMaze.Data;
|
||||
using Unity.Cinemachine;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
|
||||
namespace Items
|
||||
{
|
||||
@@ -68,6 +69,8 @@ namespace Items
|
||||
[Tooltip("Visual representation to hide after use (optional)")]
|
||||
[SerializeField] private GameObject visualRepresentation;
|
||||
|
||||
public UnityEvent OnCharacterSwitch;
|
||||
|
||||
// State
|
||||
private bool _hasBeenUsed;
|
||||
private PlayerTouchController _currentPlayerController;
|
||||
@@ -172,6 +175,7 @@ namespace Items
|
||||
if (switchSuccess)
|
||||
{
|
||||
Logging.Debug($"[ControllerSwitchItem] Successfully switched input to controller: {targetControllerName}");
|
||||
OnCharacterSwitch.Invoke();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
using Core;
|
||||
using Core.Lifecycle;
|
||||
using Items;
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Audio;
|
||||
|
||||
namespace Minigames.TrashMaze.Core
|
||||
{
|
||||
@@ -21,6 +24,13 @@ namespace Minigames.TrashMaze.Core
|
||||
|
||||
[Header("Exit")]
|
||||
[SerializeField] private Transform exitPosition;
|
||||
|
||||
public AppleAudioSource audioSource;
|
||||
public AudioResource mazeStartAudio;
|
||||
public AudioResource mazeEndAudio;
|
||||
// Placeholder refs until maze implemented 4 real
|
||||
public ControllerSwitchItem pulverControllerSwitch;
|
||||
public ControllerSwitchItem trafalgarControllerSwitch;
|
||||
|
||||
// Cached shader property IDs for performance
|
||||
private static readonly int WorldSizeID = Shader.PropertyToID("_WorldSize");
|
||||
@@ -115,8 +125,24 @@ namespace Minigames.TrashMaze.Core
|
||||
}
|
||||
|
||||
Logging.Debug($"[TrashMazeController] Pulver controller initialized at {pulverController.transform.position}");
|
||||
|
||||
// TODO: Implement proper events for maze start and finish
|
||||
pulverControllerSwitch.OnCharacterSwitch.AddListener(SwitchedToPulver);
|
||||
trafalgarControllerSwitch.OnCharacterSwitch.AddListener(SwitchedToTrafalgar);
|
||||
}
|
||||
|
||||
|
||||
private void SwitchedToTrafalgar()
|
||||
{
|
||||
audioSource.audioSource.resource = mazeEndAudio;
|
||||
audioSource.Play(0);
|
||||
}
|
||||
|
||||
private void SwitchedToPulver()
|
||||
{
|
||||
audioSource.audioSource.resource = mazeStartAudio;
|
||||
audioSource.Play(0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called when player reaches the maze exit
|
||||
/// </summary>
|
||||
@@ -131,7 +157,9 @@ namespace Minigames.TrashMaze.Core
|
||||
_mazeCompleted = true;
|
||||
|
||||
Logging.Debug("[TrashMazeController] Maze completed! Player reached exit.");
|
||||
|
||||
audioSource.audioSource.resource = mazeEndAudio;
|
||||
audioSource.Play(0);
|
||||
|
||||
// TODO: Trigger completion events
|
||||
// - Award booster packs collected
|
||||
// - Open gate for Trafalgar
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Core.SaveLoad;
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Playables;
|
||||
@@ -10,6 +11,9 @@ public class TrashmazeClosedBehaviour : MonoBehaviour
|
||||
public PlayableAsset stingTimeline;
|
||||
public PlayableAsset giveCactusTimeline;
|
||||
private PlayableDirector _director;
|
||||
public AppleMachine stateMachine;
|
||||
|
||||
public bool gaveCactus;
|
||||
|
||||
public void SwapPulverStung()
|
||||
{
|
||||
@@ -17,14 +21,22 @@ public class TrashmazeClosedBehaviour : MonoBehaviour
|
||||
pulverSprites.enabled = true;
|
||||
}
|
||||
|
||||
public void SetCactusBool(bool pulverGaveCactus)
|
||||
{
|
||||
gaveCactus = pulverGaveCactus;
|
||||
}
|
||||
|
||||
public void PlayStingTimeline()
|
||||
{
|
||||
if (!gaveCactus)
|
||||
{
|
||||
_director = GetComponent<PlayableDirector>();
|
||||
_director.playableAsset = stingTimeline;
|
||||
_director.Play();
|
||||
_director.stopped += StingTimelineStopped;
|
||||
pulverSprites.enabled=false;
|
||||
pulverStungSprites.enabled=true;
|
||||
}
|
||||
}
|
||||
|
||||
private void StingTimelineStopped(PlayableDirector obj)
|
||||
@@ -43,6 +55,7 @@ public class TrashmazeClosedBehaviour : MonoBehaviour
|
||||
|
||||
private void GiveCactusTimelineStopped(PlayableDirector director)
|
||||
{
|
||||
stateMachine.ChangeState("TrashMazeEntrance");
|
||||
_director.stopped -= GiveCactusTimelineStopped;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user