Language
Edit

BoundsExtensions.GetColliderBounds(GameObject, Bounds, LayerMask) Method

Definition

Method to get bounds using UnityEngine.Collider methods.

public static bool GetColliderBounds(UnityEngine.GameObject target, out UnityEngine.Bounds bounds, UnityEngine.LayerMask ignoreLayers);
static member GetColliderBounds : UnityEngine.GameObject * Bounds * UnityEngine.LayerMask -> bool
Public Function GetColliderBounds (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

A bounds in world space around all the colliders in a gameObject hierarchy.

ignoreLayers
UnityEngine.LayerMask

A layer mask to restrict the colliders selected.

Returns

true if bounds were calculated, otherwise false.

Remarks

If zero colliders are present, bounds will not be calculated.

Applies to