diff --git a/Assets/Scripts/Input/InputManager.cs b/Assets/Scripts/Input/InputManager.cs index 41b32a0f..bf8081d9 100644 --- a/Assets/Scripts/Input/InputManager.cs +++ b/Assets/Scripts/Input/InputManager.cs @@ -142,7 +142,7 @@ public class InputManager : MonoBehaviour Vector2 screenPos = positionAction.ReadValue(); Vector3 worldPos = Camera.main.ScreenToWorldPoint(screenPos); Vector2 worldPos2D = new Vector2(worldPos.x, worldPos.y); - Debug.Log($"[InputManager] HoldMove update at {worldPos2D}"); + // Debug.Log($"[InputManager] HoldMove update at {worldPos2D}"); defaultConsumer?.OnHoldMove(worldPos2D); } } diff --git a/Assets/Scripts/Interactions/ItemSlot.cs b/Assets/Scripts/Interactions/ItemSlot.cs index e86ac95c..3ca58876 100644 --- a/Assets/Scripts/Interactions/ItemSlot.cs +++ b/Assets/Scripts/Interactions/ItemSlot.cs @@ -139,7 +139,6 @@ namespace Interactions } else { - if (itemToSlot != null) { DebugUIMessage.Show("I'm not sure this works.", Color.yellow); @@ -148,17 +147,5 @@ namespace Interactions Interactable.BroadcastInteractionComplete(false); } } - - void Update() - { - if (_currentlySlottedItemObject != null) - { - Debug.Log($"[ItemSlot] Slotted item: {_currentlySlottedItemObject.name}"); - } - else - { - Debug.Log("[ItemSlot] No item slotted."); - } - } } } diff --git a/Assets/Scripts/PuzzleS/ObjectiveStepBehaviour.cs b/Assets/Scripts/PuzzleS/ObjectiveStepBehaviour.cs index 86b4be64..d1347484 100644 --- a/Assets/Scripts/PuzzleS/ObjectiveStepBehaviour.cs +++ b/Assets/Scripts/PuzzleS/ObjectiveStepBehaviour.cs @@ -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() diff --git a/Assets/Scripts/PuzzleS/PuzzleManager.cs b/Assets/Scripts/PuzzleS/PuzzleManager.cs index a3517e6a..38277a05 100644 --- a/Assets/Scripts/PuzzleS/PuzzleManager.cs +++ b/Assets/Scripts/PuzzleS/PuzzleManager.cs @@ -179,6 +179,14 @@ public class PuzzleManager : MonoBehaviour } } + /// + /// Returns whether a step is already unlocked. + /// + public bool IsStepUnlocked(PuzzleStepSO step) + { + return unlockedSteps.Contains(step); + } + void OnApplicationQuit() { _isQuitting = true;