Language
Edit

BoundsExtensions.GetScaleToFitInside(Bounds, Bounds) Method

Definition

Calculates how much scale is required for this UnityEngine.Bounds to fit inside another bounds without stretching.

public static float GetScaleToFitInside(this UnityEngine.Bounds bounds, UnityEngine.Bounds containerBounds);
static member GetScaleToFitInside : UnityEngine.Bounds * UnityEngine.Bounds -> single
<Extension()>
Public Function GetScaleToFitInside (bounds As Bounds, containerBounds As Bounds) As Single

Parameters

bounds
UnityEngine.Bounds

The bounds structure to examine.

containerBounds
UnityEngine.Bounds

The bounds of the container attempting to be fit into this object.

Returns

A single scale factor that can be applied to this object to fit inside the container.

Applies to