[Tools] Add a simple quest preview window for Puzzle Step SO
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
public class PuzzleManager : MonoBehaviour
|
||||
{
|
||||
@@ -62,19 +63,12 @@ public class PuzzleManager : MonoBehaviour
|
||||
|
||||
private void BuildRuntimeDependencies()
|
||||
{
|
||||
runtimeDependencies.Clear();
|
||||
foreach (var step in stepBehaviours.Keys)
|
||||
runtimeDependencies = PuzzleGraphUtility.BuildDependencyGraph(stepBehaviours.Keys);
|
||||
foreach (var step in runtimeDependencies.Keys)
|
||||
{
|
||||
runtimeDependencies[step] = new List<PuzzleStepSO>();
|
||||
}
|
||||
foreach (var step in stepBehaviours.Keys)
|
||||
{
|
||||
foreach (var unlocked in step.unlocks)
|
||||
foreach (var dep in runtimeDependencies[step])
|
||||
{
|
||||
if (!runtimeDependencies.ContainsKey(unlocked))
|
||||
runtimeDependencies[unlocked] = new List<PuzzleStepSO>();
|
||||
runtimeDependencies[unlocked].Add(step);
|
||||
Debug.Log($"[Puzzles] Step {unlocked.stepId} depends on {step.stepId}");
|
||||
Debug.Log($"[Puzzles] Step {step.stepId} depends on {dep.stepId}");
|
||||
}
|
||||
}
|
||||
Debug.Log($"[Puzzles] Runtime dependencies built. Total steps: {stepBehaviours.Count}");
|
||||
@@ -82,13 +76,11 @@ public class PuzzleManager : MonoBehaviour
|
||||
|
||||
private void UnlockInitialSteps()
|
||||
{
|
||||
foreach (var step in stepBehaviours.Keys)
|
||||
var initialSteps = PuzzleGraphUtility.FindInitialSteps(runtimeDependencies);
|
||||
foreach (var step in initialSteps)
|
||||
{
|
||||
if (runtimeDependencies[step].Count == 0)
|
||||
{
|
||||
Debug.Log($"[Puzzles] Initial step unlocked: {step.stepId}");
|
||||
UnlockStep(step);
|
||||
}
|
||||
Debug.Log($"[Puzzles] Initial step unlocked: {step.stepId}");
|
||||
UnlockStep(step);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user