UnityEngine.Physics2D.RaycastNonAlloc C# (CSharp) Method

RaycastNonAlloc() public static method

Casts a ray into the scene.

public static RaycastNonAlloc ( Vector2 origin, Vector2 direction, RaycastHit2D results, [ distance, [ layerMask, [ minDepth, [ maxDepth ) : int
origin Vector2 The point in 2D space where the ray originates.
direction Vector2 Vector representing the direction of the ray.
results RaycastHit2D Array to receive results.
distance [ Maximum distance over which to cast the ray.
layerMask [ Filter to check objects only on specific 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 RaycastNonAlloc(Vector2 origin, 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_RaycastNonAlloc(ref origin, ref direction, results, distance, layerMask, minDepth, maxDepth);
        }

Same methods

Physics2D::RaycastNonAlloc ( Vector2 origin, Vector2 direction, RaycastHit2D results ) : int
Physics2D::RaycastNonAlloc ( Vector2 origin, Vector2 direction, RaycastHit2D results, float distance ) : int
Physics2D::RaycastNonAlloc ( Vector2 origin, Vector2 direction, RaycastHit2D results, float distance, int layerMask ) : int
Physics2D::RaycastNonAlloc ( Vector2 origin, Vector2 direction, RaycastHit2D results, float distance, int layerMask, float minDepth ) : int
Physics2D