UnityEngine.Rigidbody2D.Cast C# (CSharp) Method

Cast() public method

All the Collider2D shapes attached to the Rigidbody2D are cast into the scene starting at each collider position ignoring the colliders attached to the same Rigidbody2D.

public Cast ( Vector2 direction, RaycastHit2D results, [ distance ) : int
direction Vector2 Vector representing the direction to cast each Collider2D shape.
results RaycastHit2D Array to receive results.
distance [ Maximum distance over which to cast the shape(s).
return int
        public int Cast(Vector2 direction, RaycastHit2D[] results, [DefaultValue("Mathf.Infinity")] float distance)
        {
            return INTERNAL_CALL_Cast(this, ref direction, results, distance);
        }

Same methods

Rigidbody2D::Cast ( Vector2 direction, RaycastHit2D results ) : int

Usage Example

コード例 #1
0
 static public int Cast(IntPtr l)
 {
     try {
         int argc = LuaDLL.lua_gettop(l);
         if (argc == 3)
         {
             UnityEngine.Rigidbody2D self = (UnityEngine.Rigidbody2D)checkSelf(l);
             UnityEngine.Vector2     a1;
             checkType(l, 2, out a1);
             UnityEngine.RaycastHit2D[] a2;
             checkArray(l, 3, out a2);
             var ret = self.Cast(a1, a2);
             pushValue(l, true);
             pushValue(l, ret);
             return(2);
         }
         else if (argc == 4)
         {
             UnityEngine.Rigidbody2D self = (UnityEngine.Rigidbody2D)checkSelf(l);
             UnityEngine.Vector2     a1;
             checkType(l, 2, out a1);
             UnityEngine.RaycastHit2D[] a2;
             checkArray(l, 3, out a2);
             System.Single a3;
             checkType(l, 4, out a3);
             var ret = self.Cast(a1, a2, a3);
             pushValue(l, true);
             pushValue(l, ret);
             return(2);
         }
         pushValue(l, false);
         LuaDLL.lua_pushstring(l, "No matched override function Cast to call");
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
All Usage Examples Of UnityEngine.Rigidbody2D::Cast