Rework interactables into a flatter hierarchy, reenable puzzles as well
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user