ChooseRandomChild
A class in Root.Township, the global namespace.
Editor tool: turns on one weighted random child of this object (or none), using RandomChildWeight for weights.
- Listed in Global namespace: C to D
- Inherits or implements
MonoBehaviour
Constructors
| Member | What it is |
|---|---|
ChooseRandomChild() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
2 private and internal fields
Methods
2 private and internal methods
| Member | What it is |
|---|---|
private void OnValidate() | When the button is pressed, randomises this and every nested ChooseRandomChild. |
private void RandomizeChildren() | Picks one child by weight (default 1) and activates only it; noneWeight is the chance to pick none. |