[Puzzles][Input] Update input handling to not mistakingly miss frames. Add debug frame input debugging.

This commit is contained in:
Michal Pikulski
2025-09-03 16:55:21 +02:00
parent 93242b2702
commit 1dfcee3d2c
9 changed files with 196 additions and 26 deletions

View File

@@ -10,20 +10,21 @@ public class ObjectiveStepBehaviour : MonoBehaviour
void Awake()
{
interactable = GetComponent<Interactable>();
}
void OnEnable()
{
if (interactable == null)
interactable = GetComponent<Interactable>();
if (interactable != null)
{
interactable.Interacted += OnInteracted;
}
// Register with PuzzleManager
PuzzleManager.Instance?.RegisterStepBehaviour(this);
}
void OnDestroy()
void OnDisable()
{
if (interactable != null)
{
interactable.Interacted -= OnInteracted;
}
PuzzleManager.Instance?.UnregisterStepBehaviour(this);
}