chore: Project Restructuring & Theatre

This commit is contained in:
Alexandre Coirier
2026-05-13 12:24:48 +02:00
parent 4070916c1f
commit e96d0bf6e6
2145 changed files with 20957 additions and 44792 deletions
@@ -0,0 +1,40 @@
using UnityEngine;
using Unheimlich.Core.Audio;
using Unheimlich.Features.DetectiveBoard.Data;
namespace Unheimlich.Features.DetectiveBoard
{
/// <summary>
/// Unlocks a clue when a specific AudioSource plays, finishes, or reaches a timestamp.
/// Call OnAudioPlay() from whatever drives the AudioSource to start monitoring.
/// </summary>
public class ClueUnlockOnAudio : AudioTriggerBase
{
[Header("Clue Configuration")]
[Tooltip("The clue to unlock")]
[SerializeField] private ClueData _clueToUnlock;
protected override void Execute()
{
if (_clueToUnlock == null)
{
Debug.LogError("[ClueUnlockOnAudio] No ClueData assigned!", this);
return;
}
if (DetectiveBoardManager.Instance == null)
{
Debug.LogError("[ClueUnlockOnAudio] DetectiveBoardManager not found!", this);
return;
}
DetectiveBoardManager.Instance.UnlockClue(_clueToUnlock);
if (_debugMode)
Debug.Log($"[ClueUnlockOnAudio] Unlocked clue '{_clueToUnlock.Title}' on '{_fireCondition}'.", this);
}
/// <summary>Resets the unlock state so the clue can be unlocked again.</summary>
public void ResetUnlock() => ResetFired();
}
}