GameObjectExt.GetLocalBounds Method
Calculates the GameObjectBounds in local space. The bounds are the Renderer’s bounds if there is one in the GameObject. Otherwise it will encapsulate all renderers found in the children. If forceRecurseIntoChildren is true, it will also encapsulate all renderers found in the children no matter if the GameObject has a Renderer component or not.
Namespace: UltimateXR.Extensions.Unity
Assembly: UltimateXR (in UltimateXR.dll) Version: 0.0.0.0
Syntax
C#
public static Bounds GetLocalBounds(
this GameObject self,
bool forceRecurseIntoChildren
)
Parameters
- self
- Type: GameObject
The GameObject whose local Bounds to get - forceRecurseIntoChildren
- Type: System.Boolean
Whether to also encapsulate all renderers found in the children no matter if the GameObject has a Renderer component or not
Return Value
Type: Bounds
Local Bounds.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type GameObject. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).