class

FitSize

Editor-time (and play-mode-guarded) world-size solver. Drives transform.localScale from a sibling MeshFilter's local bounds so an authored width/height/depth (aspect-locked) or explicit per-axis size becomes an exact WORLD size, independent of the mesh's native dimensions, rotation, or a scaled parent.

public sealed class FitSize : MonoBehaviour

Add it from a builder with NodeHandle.FitSize or in the inspector. It runs in edit mode only. Resize the object by hand and it reads the new world size back into value / size, so the size you drag to is the size your builder file ends up saying.

Authoring

Add this component from a NodeHandle inside Build:

FitSizemethod2 overloads

public NodeHandle FitSize(float? width = null, float? height = null, float? depth = null)

Aspect-locked world size: exactly one of width/height/ depth drives the size, aspect preserved on the other two axes.

public NodeHandle FitSize((float x, float y, float z) size)

Explicit per-axis world size (non-uniform allowed).

Members

modefield

public Mode mode

valuefield

public float value

The single authored aspect-locked dimension when mode is Width/Height/Depth. Unused (and unwritten) for Explicit/None.

sizefield

public Vector3 size

Explicit per-axis world size when mode is Explicit.

Evaluatemethod

public void Evaluate()

Recompute localScale from the current mesh bounds / intent, or (if the user manually changed localScale since our last write) back-solve the intent field(s) from the new world size instead.

Nested types

Modeenum

Which dimension drives the size. None is the default and drives nothing, so a freshly added FitSize leaves the object alone until you pick a mode.

ValueDescription
None
Width
Height
Depth
Explicit

Generated from com.codescenes/Runtime/FitSize.cs