Skip to content
Snippets Groups Projects

building: Add right click to remove buildings

Merged Verin Antoine requested to merge hotfix into main
Compare and
2 files
+ 30
5
Preferences
Compare changes
Files
2
+ 11
1
@@ -24,7 +24,11 @@ namespace UI
{
if (_selectedBuilding == null) return;
if (Input.GetMouseButtonDown(1)) _selectedBuilding = null;
if (Input.GetMouseButtonDown(1))
{
_selectedBuilding = null;
return;
}
var position = MouseToTerrainPosition();
position.y += _selectedBuilding.transform.localScale.y / 2;
@@ -67,6 +71,12 @@ namespace UI
return;
}
if (Input.GetMouseButtonDown(1) && parcel.building != null)
{
parcel.Unbuild();
return;
}
parcel.Build(_selectedBuilding);
_selectedBuilding = null;
}