RadialPopulationArea
A class in Root.Township, Alta.Populations.
Point evaluator that finds a ground point by raycasting down at a random spot within a radius of its transform.
- Listed in World generation
- Inherits or implements
MonoBehaviour,IPointNormalEvaluator - Documented in Populations and spawners
Constructors
| Member | What it is |
|---|---|
RadialPopulationArea() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
6 private and internal fields
| Member | What it is |
|---|---|
private Vector3 cachedPosition | The transform position read at the start of GetPoint. |
private List<Vector2> existing | Offsets picked so far, used for the minimum distance check. Never cleared. |
private int iterationAttempts | How many spots to try before giving up. |
private float minimumDistanceFromExisting | Minimum distance from earlier picks. Zero or less turns the check off. |
private float radius | Search radius in metres. Picks cluster toward the centre. |
private PopulationRaycast raycastTest | The raycast settings used to find the ground. |
Methods
| Member | What it is |
|---|---|
PointNormal? GetPoint() | Tries up to iterationAttempts random spots. Returns null at once if a spot is too close to an earlier one. |