Skip to main content

TriggerSphere

A class in Root.Township, the global namespace.

A TriggerShape that adds its own sphere trigger collider when initialised from code.

Constructors​

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

Fields​

1 private and internal field
MemberWhat it is
private SphereCollider sphereColliderThe sphere collider added by Initialize.

Properties​

MemberWhat it is
float Radius { get; set; }The sphere's radius, or 0 before Initialize.

Methods​

MemberWhat it is
void Initialize(float radius)Adds a trigger sphere collider with the given radius and renames the object.