Rework interactables into a flatter hierarchy, reenable puzzles as well

This commit is contained in:
Michal Pikulski
2025-09-11 13:00:26 +02:00
parent 3a40d1a151
commit e1ff13db30
32 changed files with 981 additions and 1018 deletions

View File

@@ -1,5 +1,7 @@
using UnityEngine;
using System;
using Input;
using Interactions;
/// <summary>
/// MonoBehaviour that immediately completes an interaction when started.
@@ -13,7 +15,7 @@ public class OneClickInteraction : MonoBehaviour
interactable = GetComponent<Interactable>();
if (interactable != null)
{
interactable.StartedInteraction += OnStartedInteraction;
interactable.interactionStarted.AddListener(OnInteractionStarted);
}
}
@@ -21,15 +23,15 @@ public class OneClickInteraction : MonoBehaviour
{
if (interactable != null)
{
interactable.StartedInteraction -= OnStartedInteraction;
interactable.interactionStarted.RemoveListener(OnInteractionStarted);
}
}
private void OnStartedInteraction()
private void OnInteractionStarted(PlayerTouchController playerRef, FollowerController followerRef)
{
if (interactable != null)
{
interactable.CompleteInteraction(true);
interactable.BroadcastInteractionComplete(true);
}
}
}