Hallucination system

This commit is contained in:
Ferlat Thibaud
2026-03-16 17:06:47 +01:00
parent 10faf74405
commit 0d968f75ab
44 changed files with 2860 additions and 909 deletions
@@ -131,45 +131,11 @@ namespace Unheimlich.Features.DetectiveBoard.UI
_saveData = new DetectiveBoardSaveData();
}
private void OnEnable()
{
TrySubscribeToManager();
}
private void Start()
{
TrySubscribeToManager();
}
private void TrySubscribeToManager()
{
if (DetectiveBoardManager.Instance != null)
{
DetectiveBoardManager.Instance.OnClueUnlocked -= OnClueUnlocked;
DetectiveBoardManager.Instance.OnClueUnlocked += OnClueUnlocked;
foreach (var clue in DetectiveBoardManager.Instance.GetUnlockedClues())
{
if (!_activeNodes.ContainsKey(clue.ClueID))
{
AddClueNode(clue);
}
}
}
}
private void OnDisable()
{
if (DetectiveBoardManager.Instance != null)
{
DetectiveBoardManager.Instance.OnClueUnlocked -= OnClueUnlocked;
}
}
private void OnClueUnlocked(ClueData clueData)
{
AddClueNode(clueData);
}
private void OnEnable() { }
private void Start() { }
private void OnDisable() { }
private void Update()
{
@@ -413,6 +379,19 @@ namespace Unheimlich.Features.DetectiveBoard.UI
}
}
/// <summary>
/// Returns the active PostItNode for the given clue ID, or null if not found.
/// Used by ClueHandUI to retrieve the node after placement.
/// </summary>
/// <summary>Returns true if a node for this clue ID is already placed on the board.</summary>
public bool HasNodeForClue(string clueID) => _activeNodes.ContainsKey(clueID);
public PostItNode GetNodeForClue(string clueID)
{
_activeNodes.TryGetValue(clueID, out PostItNode node);
return node;
}
public DetectiveBoardSaveData GetSaveData()
{
return _saveData;