FINALIZE THIS SHIEEEEEET
This commit is contained in:
@@ -71,9 +71,16 @@ namespace PuzzleS
|
||||
|
||||
void Start()
|
||||
{
|
||||
// Register with PuzzleManager, regardless of enabled/disabled state
|
||||
// PuzzleManager will call UnlockStep or LockStep based on current puzzle state
|
||||
PuzzleManager.Instance?.RegisterStepBehaviour(this);
|
||||
// Simply register with the PuzzleManager
|
||||
// The manager will handle state updates appropriately based on whether data is loaded
|
||||
if (stepData != null && PuzzleManager.Instance != null)
|
||||
{
|
||||
PuzzleManager.Instance.RegisterStepBehaviour(this);
|
||||
}
|
||||
else if (stepData == null)
|
||||
{
|
||||
Logging.Warning($"[Puzzles] Cannot register step on {gameObject.name}: stepData is null");
|
||||
}
|
||||
}
|
||||
|
||||
void OnDestroy()
|
||||
@@ -83,7 +90,11 @@ namespace PuzzleS
|
||||
_interactable.interactionStarted.RemoveListener(OnInteractionStarted);
|
||||
_interactable.interactionComplete.RemoveListener(OnInteractionComplete);
|
||||
}
|
||||
PuzzleManager.Instance?.UnregisterStepBehaviour(this);
|
||||
|
||||
if (PuzzleManager.Instance != null && stepData != null)
|
||||
{
|
||||
PuzzleManager.Instance.UnregisterStepBehaviour(this);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user