Added interaction on mouse click

feature/showcase_bugfixing_kathi_partII_quickfix
kziolkowski 5 months ago
parent 7c03964d33
commit 283caf282b

@ -76,6 +76,17 @@ public partial class InteractionArea2D : Node2D
return; return;
if (@event.IsAction("interact") && @event.IsPressed()) if (@event.IsAction("interact") && @event.IsPressed())
{
TryInteract();
}
if (@event.IsActionPressed("click") && @event.IsPressed())
{
TryInteract();
}
}
private void TryInteract()
{ {
if (_area.HasOverlappingBodies()) if (_area.HasOverlappingBodies())
{ {
@ -88,7 +99,6 @@ public partial class InteractionArea2D : Node2D
EmitSignal(SignalName.Interacted); EmitSignal(SignalName.Interacted);
} }
} }
}
public void SetSpriteActiveState(bool success, int id) // TODO: remove public void SetSpriteActiveState(bool success, int id) // TODO: remove
{ {

Loading…
Cancel
Save