Skip to main content

VarianceComponentExtensions

A static class in Root.Township, the global namespace.

GameObject extensions that get components of one base type and keep those that also implement another type (such as an interface).

Methods​

MemberWhat it is
static IEnumerable<TVariant> GetVariantComponents<TBase, TVariant>(GameObject gameObject)Components of type TBase on the object that are also TVariant.
static IEnumerable<TVariant> GetVariantComponentsInChildren<TBase, TVariant>(GameObject gameObject)Components of type TBase on the object and its children that are also TVariant.