Rework interactables into a flatter hierarchy, reenable puzzles as well
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
using System;
|
||||
using Input;
|
||||
using Interactions;
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
@@ -26,7 +28,7 @@ public class LevelSwitch : MonoBehaviour
|
||||
_interactable = GetComponent<Interactable>();
|
||||
if (_interactable != null)
|
||||
{
|
||||
_interactable.StartedInteraction += OnStartedInteraction;
|
||||
_interactable.characterArrived.AddListener(OnCharacterArrived);
|
||||
}
|
||||
ApplySwitchData();
|
||||
}
|
||||
@@ -38,7 +40,7 @@ public class LevelSwitch : MonoBehaviour
|
||||
{
|
||||
if (_interactable != null)
|
||||
{
|
||||
_interactable.StartedInteraction -= OnStartedInteraction;
|
||||
_interactable.characterArrived.RemoveListener(OnCharacterArrived);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +73,7 @@ public class LevelSwitch : MonoBehaviour
|
||||
/// <summary>
|
||||
/// Handles the start of an interaction (shows confirmation menu and switches the level if confirmed).
|
||||
/// </summary>
|
||||
private void OnStartedInteraction()
|
||||
private void OnCharacterArrived()
|
||||
{
|
||||
if (switchData == null || string.IsNullOrEmpty(switchData.targetLevelSceneName) || !_isActive)
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user