format
typescript
Bounds.extentsclass: Bounds
description
The size of the bounding box (always half the size of the bounding box).
This method is commonly used to get the size of the bounding box to fit game objects or elements in the scene.
parameter
| param_name | type | description |
|---|
reture
| type | description |
|---|---|
Vector3 | The size of the bounding box. |
code example
typescript
let bounds = new Bounds(new Vector3(1, 1, 1), new Vector3(1, 1, 1));
let extents = bounds.extents;//Get the extents
bounds.extents = new Vector3(2, 2, 2);//Set the extents