Improved detective board system
This commit is contained in:
@@ -67,17 +67,32 @@ namespace Unheimlich.Managers
|
||||
BoardPosition = clueData.InitialPosition
|
||||
};
|
||||
|
||||
Debug.Log($"[DetectiveBoardManager] Unlocked clue: {clueData.Title}");
|
||||
OnClueUnlocked?.Invoke(clueData);
|
||||
}
|
||||
else if (!_clueStates[clueData.ClueID].IsUnlocked)
|
||||
{
|
||||
_clueStates[clueData.ClueID].IsUnlocked = true;
|
||||
Debug.Log($"[DetectiveBoardManager] Unlocked clue: {clueData.Title}");
|
||||
OnClueUnlocked?.Invoke(clueData);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a list of all currently unlocked clues.
|
||||
/// Used by DetectiveBoardCanvas to display already-unlocked clues on initialization.
|
||||
/// </summary>
|
||||
public List<ClueData> GetUnlockedClues()
|
||||
{
|
||||
List<ClueData> unlockedClues = new List<ClueData>();
|
||||
foreach (var state in _clueStates.Values)
|
||||
{
|
||||
if (state.IsUnlocked)
|
||||
{
|
||||
unlockedClues.Add(state.Data);
|
||||
}
|
||||
}
|
||||
return unlockedClues;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Unlocks a clue by its ID string.
|
||||
/// </summary>
|
||||
@@ -88,7 +103,6 @@ namespace Unheimlich.Managers
|
||||
if (!state.IsUnlocked)
|
||||
{
|
||||
state.IsUnlocked = true;
|
||||
Debug.Log($"[DetectiveBoardManager] Unlocked clue: {state.Data.Title}");
|
||||
OnClueUnlocked?.Invoke(state.Data);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user