Skip to main content

RandomChildWeight

A class in Root.Township, the global namespace.

Gives a child object a weight for ChooseRandomChild, which picks one child by weight. Children without it count as weight 1.

Constructors​

MemberWhat it is
RandomChildWeight()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

1 private and internal field
MemberWhat it is
private float weightBacking field for Weight.

Properties​

MemberWhat it is
float Weight { get; }Weight of this child in a random pick, 1 by default.