Skip to main content

PlacementObject

A class in Root.Township, the global namespace.

Component that stores the size of an object for placement, with an editor tickbox that measures it from the child renderers.

Constructors​

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

Fields​

2 private and internal fields
MemberWhat it is
private Vector3 boundsBacking field for Size.
private bool getBoundsEditor tickbox that triggers measuring, then clears itself.

Properties​

MemberWhat it is
Vector3 Size { get; }The stored size of the object.

Methods​

2 private and internal methods
MemberWhat it is
private void OnDrawGizmosSelected()Draws the stored bounds in the editor.
private void OnValidate()When getBounds is ticked, measures the child renderers' bounds and stores the size.