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 : MonoBehaviourAdd 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.
Members
modefield
public Mode modevaluefield
public float valueThe single authored aspect-locked dimension when mode is Width/Height/Depth. Unused (and unwritten) for Explicit/None.
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.
| Value | Description |
|---|---|
None | |
Width | |
Height | |
Depth | |
Explicit |