🚧 WIP: trying to rework the detection system (it fails)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using Babushka.scripts.CSharp.Common.Services;
|
||||
using Godot;
|
||||
using Godot.Collections;
|
||||
|
||||
namespace Babushka.scripts.CSharp.Common.CharacterControls;
|
||||
|
||||
@@ -10,7 +11,7 @@ public partial class Detector : Area2D
|
||||
{
|
||||
|
||||
[Export] private bool _active = true;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Called when entering an interactionArea node.
|
||||
/// </summary>
|
||||
@@ -41,7 +42,7 @@ public partial class Detector : Area2D
|
||||
/// Called every time this node enters an Area2D.
|
||||
/// </summary>
|
||||
/// <param name="area"></param>
|
||||
public void OnEnteredInteractable(Node area)
|
||||
public void OnEnteredInteractable(Area2D area)
|
||||
{
|
||||
if (!_active || !InputService.Instance.InputEnabled)
|
||||
return;
|
||||
@@ -56,13 +57,14 @@ public partial class Detector : Area2D
|
||||
/// Called whenever this node exits an Area2D.
|
||||
/// </summary>
|
||||
/// <param name="area"></param>
|
||||
public void OnExitedInteractable(Node area)
|
||||
public void OnExitedInteractable(Area2D area)
|
||||
{
|
||||
if (!_active || !InputService.Instance.InputEnabled)
|
||||
return;
|
||||
|
||||
if (area is DetectableInteractionArea interactionArea2D)
|
||||
{
|
||||
|
||||
EmitSignal(SignalName.InteractableExited);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user