AttachToCollider() public method

public AttachToCollider ( Collider collider ) : void
collider Collider
return void
 static public int AttachToCollider(IntPtr l)
 {
     try {
         int argc = LuaDLL.lua_gettop(l);
         if (argc == 2)
         {
             UnityEngine.InteractiveCloth self = (UnityEngine.InteractiveCloth)checkSelf(l);
             UnityEngine.Collider         a1;
             checkType(l, 2, out a1);
             self.AttachToCollider(a1);
             return(0);
         }
         else if (argc == 3)
         {
             UnityEngine.InteractiveCloth self = (UnityEngine.InteractiveCloth)checkSelf(l);
             UnityEngine.Collider         a1;
             checkType(l, 2, out a1);
             System.Boolean a2;
             checkType(l, 3, out a2);
             self.AttachToCollider(a1, a2);
             return(0);
         }
         else if (argc == 4)
         {
             UnityEngine.InteractiveCloth self = (UnityEngine.InteractiveCloth)checkSelf(l);
             UnityEngine.Collider         a1;
             checkType(l, 2, out a1);
             System.Boolean a2;
             checkType(l, 3, out a2);
             System.Boolean a3;
             checkType(l, 4, out a3);
             self.AttachToCollider(a1, a2, a3);
             return(0);
         }
         LuaDLL.luaL_error(l, "No matched override function to call");
         return(0);
     }
     catch (Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return(0);
     }
 }
Example #2
0
 public void EnableRope(bool enable)
 {
     if (cloth != null)
         Destroy(cloth.gameObject);
     
     enabled = enable;
     rigidbody.isKinematic = false;
     attached = false;
     
     rigidbody.useGravity = enable;
     rigidbody.velocity = Vector3.zero;
     if (enable)
     {
         cloth = ((GameObject)Instantiate(clothPrefab, pl.pos, Quaternion.identity));            
         Cloth = cloth.GetComponentInChildren<InteractiveCloth>();
         oldpos = pos = cloth.transform.Find("s2").position;
         Cloth.AttachToCollider(pl.RopeColl,false,false);
         Cloth.AttachToCollider(this.collider, false, true);
     }
 }