LinkedMesh
A class in Root.Township, the global namespace.
Builder component for chains of linked pieces: each link sits Length away from its Previous link and spawns one of its Prefabs as a child. Probably an editor tool for laying out ropes or fences.
- Listed in Global namespace: I to L
- Inherits or implements
MonoBehaviour,IIgnoreForStaticFlatten,IDontSplit - Attributes
SelectionBase
Constructors
| Member | What it is |
|---|---|
LinkedMesh() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
7 private and internal fields
| Member | What it is |
|---|---|
private GameObject child | The currently spawned prefab instance. |
private bool isAddingChild | Serialized flag that nothing in this class reads; probably used by an editor script. |
private float length | Backing field for Length. |
private int oldIndex | Last applied prefab index, so PrefabIndex only respawns when the value changes or the child is missing. |
private int prefabIndex | Backing field for PrefabIndex. |
private GameObject[] prefabs | Backing field for Prefabs. |
private LinkedMesh previous | Backing field for Previous. |
Properties
| Member | What it is |
|---|---|
float Length { get; set; } | Distance this link keeps from Previous. |
int PrefabIndex { get; set; } | Which entry of Prefabs is spawned as the child. Setting it destroys the current child and spawns the new prefab at the local origin. |
GameObject[] Prefabs { get; set; } | Prefabs this link can show; PrefabIndex picks one. |
LinkedMesh Previous { get; set; } | The link before this one. Setting it moves this link Length away from it and turns it to face back along the chain. |