Edit

Share via


BoundsExtensions.GetRenderBounds(GameObject, Bounds, LayerMask) Method

Definition

Method to get bounds using renderer method.

public:
 static bool GetRenderBounds(UnityEngine::GameObject ^ target, [Runtime::InteropServices::Out] UnityEngine::Bounds % bounds, UnityEngine::LayerMask ignoreLayers);
public static bool GetRenderBounds (UnityEngine.GameObject target, out UnityEngine.Bounds bounds, UnityEngine.LayerMask ignoreLayers);
static member GetRenderBounds : UnityEngine.GameObject * Bounds * UnityEngine.LayerMask -> bool
Public Function GetRenderBounds (target As GameObject, ByRef bounds As Bounds, ignoreLayers As LayerMask) As Boolean

Parameters

target
UnityEngine.GameObject

GameObject to generate the bounds around.

bounds
UnityEngine.Bounds

An AABB in world space around all the renderers in a gameObject hierarchy.

ignoreLayers
UnityEngine.LayerMask

A LayerMask to restrict the colliders selected.

Returns

True if bounds were calculated, if zero renderers are present bounds will not be calculated.

Applies to