UnityEngine.Physics2D.BoxCastNonAlloc C# (CSharp) Method

BoxCastNonAlloc() public static method

Casts a box into the scene, returning colliders that contact with it into the provided results array.

public static BoxCastNonAlloc ( Vector2 origin, Vector2 size, float angle, Vector2 direction, RaycastHit2D results, [ distance, [ layerMask, [ minDepth, [ maxDepth ) : int
origin Vector2 The point in 2D space where the shape originates.
size Vector2 The size of the shape.
angle float The angle of the shape (in degrees).
direction Vector2 Vector representing the direction of the shape.
results RaycastHit2D Array to receive results.
distance [ Maximum distance over which to cast the shape.
layerMask [ Filter to detect Colliders only on certain layers.
minDepth [ Only include objects with a Z coordinate (depth) greater than or equal to this value.
maxDepth [ Only include objects with a Z coordinate (depth) less than or equal to this value.
return int
        public static int BoxCastNonAlloc(Vector2 origin, Vector2 size, float angle, Vector2 direction, RaycastHit2D[] results, [DefaultValue("Mathf.Infinity")] float distance, [DefaultValue("DefaultRaycastLayers")] int layerMask, [DefaultValue("-Mathf.Infinity")] float minDepth, [DefaultValue("Mathf.Infinity")] float maxDepth)
        {
            return INTERNAL_CALL_BoxCastNonAlloc(ref origin, ref size, angle, ref direction, results, distance, layerMask, minDepth, maxDepth);
        }

Same methods

Physics2D::BoxCastNonAlloc ( Vector2 origin, Vector2 size, float angle, Vector2 direction, RaycastHit2D results ) : int
Physics2D::BoxCastNonAlloc ( Vector2 origin, Vector2 size, float angle, Vector2 direction, RaycastHit2D results, float distance ) : int
Physics2D::BoxCastNonAlloc ( Vector2 origin, Vector2 size, float angle, Vector2 direction, RaycastHit2D results, float distance, int layerMask ) : int
Physics2D::BoxCastNonAlloc ( Vector2 origin, Vector2 size, float angle, Vector2 direction, RaycastHit2D results, float distance, int layerMask, float minDepth ) : int
Physics2D