Class RouteManagerUtil
Route Manager helper methods specific to Eco.Gameplay.
Inheritance
Namespace: Eco.Gameplay.Utils
Assembly: Eco.Gameplay.dll
Syntax
public static class RouteManagerUtil : Object
Methods
DestroyPlantsWithinRadius(WorldPosition3i, Int32)
Destroys all plants at position within radius with a top down projection.
Declaration
public static void DestroyPlantsWithinRadius(WorldPosition3i position, int radius)
Parameters
Type | Name | Description |
---|---|---|
WorldPosition3i | position | |
System.Int32 | radius |
DestroyTreesWithinRadius(WorldPosition3i, Int32)
Destroys all trees at position within radius with a top down projection.
Declaration
public static void DestroyTreesWithinRadius(WorldPosition3i position, int radius)
Parameters
Type | Name | Description |
---|---|---|
WorldPosition3i | position | |
System.Int32 | radius |
TryGetNearestWalkableAreaWithoutFoliage(WrappedPosition3i, out WorldPosition3i, Int32, Int32, Int32, Int32, Func<Plant, Boolean>, Boolean, Boolean)
Finds the nearest walkable area near startPos. Looks for an area without any adjacent foliage (Use predicate to add plants to skip).
If still no suitable area was found then pick a new spot and destroy all adjacent foliage if destroyPlants or destroyTrees is true.
Declaration
public static bool TryGetNearestWalkableAreaWithoutFoliage(WrappedPosition3i startPos, out WorldPosition3i walkable, int searchRadius, int safeRadius, int destroyPlantsRadius = 0, int destroyTreesRadius = 0, Func<Plant, bool> plantPredicate = null, bool clearTerrain = false, bool avoidStartPos = false)
Parameters
Type | Name | Description |
---|---|---|
WrappedPosition3i | startPos | The starting world position. If TryGetNearestWalkableAreaWithoutFoliage(WrappedPosition3i, out WorldPosition3i, Int32, Int32, Int32, Int32, Func<Plant, Boolean>, Boolean, Boolean) returns false then walkable will default to startPos. |
WorldPosition3i | walkable | |
System.Int32 | searchRadius | The radius in meters to search outwards from startPos. |
System.Int32 | safeRadius | The radius in meters required for a spawn point to be considered "suitable". Ie. Size of area with no foliage. |
System.Int32 | destroyPlantsRadius | |
System.Int32 | destroyTreesRadius | |
System.Func<Plant, System.Boolean> | plantPredicate | Condition to meet when comparing plants. Ie. Plants to skip when pathfinding. Ex. Add "plant.Species.Name.Equals("CommonGrass")" to skip grass when checking for plants. |
System.Boolean | clearTerrain | clears terrain around spawn point, won't destroy world objects |
System.Boolean | avoidStartPos |
Returns
Type | Description |
---|---|
System.Boolean |