Bearbeiten

Freigeben über


BoundsExtensions Class

Definition

Extension methods for Unity's Bounds struct

public ref class BoundsExtensions abstract sealed
public static class BoundsExtensions
type BoundsExtensions = class
Public Module BoundsExtensions
Inheritance
BoundsExtensions

Fields

BCK
BOT
FWD
LB
LB_LT
LBB
LBF
LBF_LBB
LBF_RBF
LFT
LT
LT_RT
LTB
LTB_LBB
LTF
LTF_LBF
LTF_LTB
LTF_RTF
RB
RB_LB
RBB
RBB_LBB
RBF
RBF_RBB
RHT
RT
RT_RB
RTB
RTB_LTB
RTB_RBB
RTF
RTF_RBF
RTF_RTB
TOP

Methods

CloserToPoint(Bounds, Vector3, Bounds)

Checks to see whether point is closer to bounds or otherBounds

ContainsBounds(Bounds, Bounds)

Checks to see if bounds contains the other bounds completely.

DebugDraw(Bounds, Color, Single, Boolean)

Draws a wire frame Bounds object using Debug.DrawLine.

ExpandToContain(Bounds, Bounds)

Returns bounds that contain both this bounds and the bounds passed in.

GetColliderBounds(GameObject, Bounds, LayerMask)

Method to get bounds using collider method.

GetColliderBoundsPoints(Collider, List<Vector3>, LayerMask, Transform)

Method to get bounds from a single Collider

GetColliderBoundsPoints(GameObject, List<Vector3>, LayerMask, Transform)

Method to get bounding box points using Collider method.

GetCornerAndMidPointPositions(Bounds, Transform, Vector3[])

Gets all the corner points and mid points from Renderer's Bounds

GetCornerAndMidPointPositions2D(Bounds, Transform, Vector3[], BoundsExtensions+Axis)

Gets all the corner points and mid points from Renderer's Bounds, ignoring the z axis

GetCornerPositions(Bounds, Transform, Vector3[])

Gets all the corner points of the bounds in world space by transforming input bounds using the given transform

GetCornerPositions(Bounds, Vector3[])

Gets all the corner points of the bounds

GetCornerPositionsFromRendererBounds(Bounds, Vector3[])

Gets all the corner points from Renderer's Bounds

GetFacePositions(Bounds, Transform, Vector3[])
GetInvalidBoundsInstance()

Returns an instance of the 'Bounds' class which is invalid. An invalid 'Bounds' instance is one which has its size vector set to 'float.MaxValue' for all 3 components. The center of an invalid bounds instance is the zero vector.

GetMeshFilterBounds(GameObject, Bounds, LayerMask)

Method to get bounds using mesh filters method.

GetMeshFilterBoundsPoints(GameObject, List<Vector3>, LayerMask)

GetMeshFilterBoundsPoints - gets bounding box points using MeshFilter method.

GetPointsBounds(List<Vector3>, Bounds)

Method to get bounds from a collection of points.

GetRenderBounds(GameObject, Bounds, LayerMask)

Method to get bounds using renderer method.

GetRenderBoundsPoints(GameObject, List<Vector3>, LayerMask)

GetRenderBoundsPoints gets bounding box points using Render method.

GetScaleToFitInside(Bounds, Bounds)

Calculates how much scale is required for this Bounds to fit inside another bounds without stretching.

GetScaleToMatchBounds(Bounds, Bounds, Vector3)

Calculates how much scale is required for this Bounds to match another Bounds.

GetScreenRectangle(Bounds, Camera)

Returns the rectangle which encloses the specifies 'Bounds' instance in screen space.

GetScreenSpaceCornerPoints(Bounds, Camera)

Returns the screen space corner points of the specified 'Bounds' instance.

IsValid(Bounds)

Checks if the specified bounds instance is valid. A valid 'Bounds' instance is one whose size vector does not have all 3 components set to 'float.MaxValue'.

Transform(Bounds, Matrix4x4)

Transforms 'bounds' using the specified transform matrix.

Volume(Bounds)

Returns the volume of the bounds.

Applies to