Skip to main content

RigidbodyCollection

A class in Root.Township, the global namespace.

Holds a list of rigidbodies, filled from children in the editor, and gives them as a set.

Constructors​

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

Fields​

2 private and internal fields
MemberWhat it is
private List<Rigidbody> rigidbodiesSerialized list of rigidbodies.
private HashSet<Rigidbody> uniqueRigidbodiesCached set behind Rigidbodies.

Properties​

MemberWhat it is
HashSet<Rigidbody> Rigidbodies { get; }The rigidbodies as a set without duplicates, built on first use.

Methods​

1 private and internal method
MemberWhat it is
private void Reset()Editor: fills the list with every rigidbody in the children.

Used in​

Members of other types that take, return or hold a RigidbodyCollection: