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,37 @@
using UnityEngine;
using Unheimlich.Core.Audio;
namespace Unheimlich.Features.Hallucination
{
/// <summary>
/// Fires a hallucination effect when a specific AudioSource plays, finishes, or reaches a timestamp.
/// Call OnAudioPlay() from whatever drives the AudioSource to start monitoring.
/// </summary>
public class HallucinationOnAudio : AudioTriggerBase
{
[Header("Hallucination Payload")]
[Tooltip("Amount of insanity to add when this fires (0 = no change)")]
[SerializeField, Range(0f, 1f)] private float _insanityAmount = 0f;
[Tooltip("Optional discrete hallucination event to fire")]
[SerializeField] private HallucinationEvent _hallucinationEvent;
protected override void Execute()
{
if (HallucinationManager.Instance == null)
{
Debug.LogError("[HallucinationOnAudio] HallucinationManager not found!", this);
return;
}
if (_insanityAmount > 0f)
HallucinationManager.Instance.AddInsanity(_insanityAmount);
if (_hallucinationEvent != null)
HallucinationManager.Instance.TriggerHallucinationEvent(_hallucinationEvent);
if (_debugMode)
Debug.Log($"[HallucinationOnAudio] Fired on '{_fireCondition}'. Sanity: {HallucinationManager.Instance.SanityLevel:F2}", this);
}
}
}