handle primary action inputs
This commit is contained in:
parent
635a832ec8
commit
8708540770
5 changed files with 7 additions and 1 deletions
|
|
@ -90,6 +90,7 @@ public partial class PlantField : Node2D
|
|||
|
||||
if (@event.IsActionPressed("primary_action") && _previousCanPlace)
|
||||
{
|
||||
GetViewport().SetInputAsHandled();
|
||||
var plant = _resource.Scene.Instantiate<RuntimePlantData>();
|
||||
PoolContainer.Instance.Plants.AddChild(plant);
|
||||
plant.GlobalPosition = (_plantSetter.GlobalPosition / FieldParams.Tile).Ceil() * FieldParams.Tile - new Vector2(20, 14);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue