Bearbeiten

Freigeben über


BoundsExtensions.GetScaleToFitInside(Bounds, Bounds) Method

Definition

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

public:
[System::Runtime::CompilerServices::Extension]
 static float GetScaleToFitInside(UnityEngine::Bounds bounds, UnityEngine::Bounds containerBounds);
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
containerBounds
UnityEngine.Bounds

The bounds of the container we're trying to fit this object.

Returns

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

Applies to