Simple interactable rework

This commit is contained in:
Michal Pikulski
2025-10-31 13:50:08 +01:00
parent 095f21908b
commit 917230e10a
15 changed files with 1897 additions and 103 deletions

View File

@@ -8,7 +8,7 @@ namespace PuzzleS
/// <summary>
/// Manages the state and interactions for a single puzzle step, including unlock/lock logic and event handling.
/// </summary>
[RequireComponent(typeof(Interactable))]
[RequireComponent(typeof(InteractableBase))]
public class ObjectiveStepBehaviour : MonoBehaviour, IPuzzlePrompt
{
/// <summary>
@@ -20,7 +20,7 @@ namespace PuzzleS
[SerializeField] private GameObject puzzleIndicator;
[SerializeField] private bool drawPromptRangeGizmo = true;
private Interactable _interactable;
private InteractableBase _interactable;
private bool _isUnlocked = false;
private bool _isCompleted = false;
private IPuzzlePrompt _indicator;
@@ -33,7 +33,7 @@ namespace PuzzleS
void Awake()
{
_interactable = GetComponent<Interactable>();
_interactable = GetComponent<InteractableBase>();
// Initialize the indicator if it exists, but ensure it's hidden initially
if (puzzleIndicator != null)
@@ -60,7 +60,7 @@ namespace PuzzleS
void OnEnable()
{
if (_interactable == null)
_interactable = GetComponent<Interactable>();
_interactable = GetComponent<InteractableBase>();
if (_interactable != null)
{