Code cleanup part 2
This commit is contained in:
@@ -1,34 +0,0 @@
|
||||
using Godot;
|
||||
|
||||
namespace Babushka.scripts.CSharp.Common.CharacterControls;
|
||||
|
||||
public partial class InteractionArea : Node3D
|
||||
{
|
||||
[Export] private Area3D _area;
|
||||
[Export] private Label3D _label;
|
||||
[Export] private bool _showLabel = true;
|
||||
|
||||
[Signal]
|
||||
public delegate void InteractedEventHandler();
|
||||
|
||||
public void OnPlayerEntered(Node3D player)
|
||||
{
|
||||
if(_showLabel)
|
||||
_label.Show();
|
||||
}
|
||||
|
||||
public void OnPlayerExited(Node3D player)
|
||||
{
|
||||
_label.Hide();
|
||||
}
|
||||
|
||||
public override void _Input(InputEvent @event)
|
||||
{
|
||||
if (@event.IsAction("interact") && @event.IsPressed() && _area.HasOverlappingBodies())
|
||||
{
|
||||
_label.Hide();
|
||||
EmitSignal(SignalName.Interacted);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
uid://5fwv33fkvy5
|
||||
Reference in New Issue
Block a user