A class in Root.Township, Alta.Caves.Displays.
Generated network behaviour that spawns a random number of child prefabs around itself and adds them to a Cluster. Server side, saved as children.
Constructors
| Member | What it is |
|---|
ClusterGenerator() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
5 private and internal fields
| Member | What it is |
|---|
private Cluster cluster | The cluster the spawned children are added to. |
private bool isGeneratingFirstTime | Backing field for IsGeneratingFirstTime. |
private static Logger logger | NLog logger for this class. |
private ObjectPipeline prefab | Object pipeline that picks the networked prefab to spawn. |
private ClusterSettings settings | Cluster settings: child count curve and how children are placed. |
Properties
| Member | What it is |
|---|
protected override bool IsGeneratingFirstTime { get; } | Returns isGeneratingFirstTime, so whether it generates on first spawn is set per prefab. |
Methods
| Member | What it is |
|---|
protected override void Generate(SpawnData spawnData) | Spawns a count of prefabs picked from the settings curve, positions each with the settings and adds them to the cluster. |
2 private and internal methods
| Member | What it is |
|---|
private void OnDrawGizmos() | Editor: draws the cluster's offset radius as a red wire sphere. |
private void PositionChild(NetworkEntity child) | Places a spawned child using the cluster settings. |