LinearPartClonerPart
A class in Root.Township, the global namespace.
Generation part that works out how many repeated parts fit along a forest path edge and tells its linear cloners to spawn that many.
- Listed in Global namespace: I to L
- Inherits or implements
GeneratablePart - Attributes
AddComponentMenu
Constructors
| Member | What it is |
|---|---|
LinearPartClonerPart() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
7 private and internal fields
| Member | What it is |
|---|---|
private float baseInset | Length taken off per cloner before fitting parts. |
private float baseLength | Fixed length per cloner before the repeated parts. |
private List<LinearPartCloner> cloners | Cloners in the prefab told directly how many parts to spawn. |
private List<SpawnerPart> clonerSpawner | Spawners whose spawned objects hold the cloners, used when cloners is empty. |
private float partLength | Length of one repeated part. |
private int parts | Number of parts each cloner spawns. |
private PathEndsPart pathEndsPart | Optional part whose end distance is set so the run is centred. |
Methods
| Member | What it is |
|---|---|
override void GenerateDynamic(GenerationCore core) | Tells the cloner on each spawner's last spawned object to spawn the counted parts. |
override void GenerateStatic(GenerationCore core, bool isModifyingTerrain) | Runs Process with the number of cloners, or of cloner spawners if there are no cloners. |
1 private and internal method
| Member | What it is |
|---|---|
private void Process(GenerationCore core, int count) | From the edge length, takes off the base length and inset per cloner and divides the rest by partLength. Also centres pathEndsPart. |