no message

This commit is contained in:
2026-03-19 22:32:52 +00:00
parent 539ffe3cd0
commit 623ad6f509
5 changed files with 92 additions and 2 deletions

View File

@@ -74,6 +74,17 @@ public class UnitCommander : MonoBehaviour
//called when we command units to gather a resource
void UnitsGatherResource(ResourceSource resource, Unit[] units)
{
if(units.Length == 1)
{
units[0].GatherResource(resource, UnitMover.GetUnitDestinationAroundResource(resource.transform.position));
}
else
{
Vector3[] destinations = UnitMover.GetUnitGroupDestinationsAroundResource(resource.transform.position, units.Length);
for(int x = 0; x <units.Length; x++)
{
units[x].GatherResource(resource, destinations[x]);
}
}
}
}