Introduced dialogue graph magic, created assest and importers. Added events for broadcasting puzzle steps
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using PuzzleS;
|
||||
using UnityEngine.SceneManagement;
|
||||
using System; // added for Action<T>
|
||||
|
||||
/// <summary>
|
||||
/// Manages puzzle step registration, dependency management, and step completion for the puzzle system.
|
||||
@@ -32,6 +33,10 @@ public class PuzzleManager : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
// Events to notify about step lifecycle
|
||||
public event Action<PuzzleStepSO> StepCompleted;
|
||||
public event Action<PuzzleStepSO> StepUnlocked;
|
||||
|
||||
private HashSet<PuzzleStepSO> completedSteps = new HashSet<PuzzleStepSO>();
|
||||
private HashSet<PuzzleStepSO> unlockedSteps = new HashSet<PuzzleStepSO>();
|
||||
|
||||
@@ -122,6 +127,10 @@ public class PuzzleManager : MonoBehaviour
|
||||
if (completedSteps.Contains(step)) return;
|
||||
completedSteps.Add(step);
|
||||
Debug.Log($"[Puzzles] Step completed: {step.stepId}");
|
||||
|
||||
// Broadcast completion
|
||||
StepCompleted?.Invoke(step);
|
||||
|
||||
foreach (var unlock in step.unlocks)
|
||||
{
|
||||
if (AreRuntimeDependenciesMet(unlock))
|
||||
@@ -165,6 +174,9 @@ public class PuzzleManager : MonoBehaviour
|
||||
behaviour.UnlockStep();
|
||||
}
|
||||
Debug.Log($"[Puzzles] Step unlocked: {step.stepId}");
|
||||
|
||||
// Broadcast unlock
|
||||
StepUnlocked?.Invoke(step);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user