Fix issues with disabled puzzle steps not registering with puzzle manager
This commit is contained in:
@@ -32,6 +32,11 @@ namespace PuzzleS
|
||||
_interactable.interactionComplete.AddListener(OnInteractionComplete);
|
||||
}
|
||||
PuzzleManager.Instance?.RegisterStepBehaviour(this);
|
||||
// Check if this step was already unlocked
|
||||
if (stepData != null && PuzzleManager.Instance != null && PuzzleManager.Instance.IsStepUnlocked(stepData))
|
||||
{
|
||||
UnlockStep();
|
||||
}
|
||||
}
|
||||
|
||||
void OnDestroy()
|
||||
|
||||
@@ -179,6 +179,14 @@ public class PuzzleManager : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns whether a step is already unlocked.
|
||||
/// </summary>
|
||||
public bool IsStepUnlocked(PuzzleStepSO step)
|
||||
{
|
||||
return unlockedSteps.Contains(step);
|
||||
}
|
||||
|
||||
void OnApplicationQuit()
|
||||
{
|
||||
_isQuitting = true;
|
||||
|
||||
Reference in New Issue
Block a user