Some shortcuts, cancellable shovel and pause fix
This commit is contained in:
parent
6e84edafea
commit
50887a3e19
8 changed files with 99 additions and 53 deletions
|
|
@ -24,18 +24,22 @@ public partial class ShovelButton : TextureButton
|
|||
{
|
||||
var checkedPosition = (PoolContainer.Instance.Plants.GetGlobalMousePosition() / Utility.Tile).Ceil() * Utility.Tile - new Vector2(20, 14);
|
||||
|
||||
for (int i = Utility.LayersCount-1; i >= 0; i--)
|
||||
for (int i = Utility.LayersCount - 1; i >= 0; i--)
|
||||
{
|
||||
if (PoolContainer.Instance.EntityField[i].TryGetValue(checkedPosition, out var entity) && entity is RuntimePlantData plantData)
|
||||
{
|
||||
plantData.Kill();
|
||||
|
||||
PoolContainer.Instance.SpawnParticles(particles, plantData.GlobalPosition + Vector2.Down * Utility.TileHeight/2.0f);
|
||||
PoolContainer.Instance.SpawnParticles(particles, plantData.GlobalPosition + Vector2.Down * Utility.TileHeight / 2.0f);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
ButtonPressed = false;
|
||||
}
|
||||
if (@event.IsActionPressed("cancel_plant") && ButtonPressed)
|
||||
{
|
||||
ButtonPressed = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue