-
Notifications
You must be signed in to change notification settings - Fork 0
Bounds Extensions
Andrzej Kebab edited this page Feb 2, 2024
·
2 revisions
Deconstructs a Bounds instance into its center and size components.
Bounds bounds = // Your Bounds instance;
Vector3 center, size;
bounds.Deconstruct(out center, out size);Parameters:
-
bounds: The Bounds instance. -
center: The center of the Bounds. -
size: The size of the Bounds.
Deconstructs a Bounds instance into its center, size, min, and max components.
Bounds bounds = // Your Bounds instance;
Vector3 center, size, min, max;
bounds.Deconstruct(out center, out size, out min, out max);Parameters:
-
bounds: The Bounds instance. -
center: The center of the Bounds. -
size: The size of the Bounds. -
min: The minimum point of the Bounds. -
max: The maximum point of the Bounds.
Creates a new Bounds instance with the specified center and size, or the original center and size if not specified.
Bounds bounds = // Your original Bounds instance;
Vector3? center = // Your new center, or null to keep the original center;
Vector3? size = // Your new size, or null to keep the original size;
Bounds result = bounds.With(center, size);Parameters:
-
bounds: The original Bounds instance. -
center: The center of the new Bounds. If null, the center of the original Bounds is used. -
size: The size of the new Bounds. If null, the size of the original Bounds is used.
Returns:
-
result: A new Bounds instance with the specified center and size.