parent
c6ec99e87a
commit
31f19ad139
File diff suppressed because it is too large
Load Diff
@ -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
|
|
||||||
@ -1,16 +0,0 @@
|
|||||||
using Godot;
|
|
||||||
|
|
||||||
namespace Babushka.scripts.CSharp.Common.Inventory;
|
|
||||||
|
|
||||||
public partial class ItemOnGroundSpawnWith2D : Node
|
|
||||||
{
|
|
||||||
[Export] private ItemResource? _blueprint = null;
|
|
||||||
|
|
||||||
public override void _EnterTree()
|
|
||||||
{
|
|
||||||
if(_blueprint == null) return;
|
|
||||||
|
|
||||||
var parent = GetParent<ItemOnGround2D>();
|
|
||||||
parent.itemInstance = new ItemInstance { blueprint = _blueprint };
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1 +0,0 @@
|
|||||||
uid://bdsel2amlbnuq
|
|
||||||
Loading…
Reference in new issue