Example #1
0
    static void InteractiveCloth_isTeared(JSVCall vc)
    {
        UnityEngine.InteractiveCloth _this = (UnityEngine.InteractiveCloth)vc.csObj;
        var result = _this.isTeared;

        JSApi.setBooleanS((int)JSApi.SetType.Rval, (System.Boolean)(result));
    }
 static public int constructor(IntPtr l)
 {
     UnityEngine.InteractiveCloth o;
     o = new UnityEngine.InteractiveCloth();
     pushObject(l, o);
     return(1);
 }
 static public int set_mesh(IntPtr l)
 {
     UnityEngine.InteractiveCloth o = (UnityEngine.InteractiveCloth)checkSelf(l);
     UnityEngine.Mesh             v;
     checkType(l, 2, out v);
     o.mesh = v;
     return(0);
 }
    static public int set_pressure(IntPtr l)
    {
        UnityEngine.InteractiveCloth o = (UnityEngine.InteractiveCloth)checkSelf(l);
        float v;

        checkType(l, 2, out v);
        o.pressure = v;
        return(0);
    }
    static public int set_tearFactor(IntPtr l)
    {
        UnityEngine.InteractiveCloth o = (UnityEngine.InteractiveCloth)checkSelf(l);
        float v;

        checkType(l, 2, out v);
        o.tearFactor = v;
        return(0);
    }
    static public int set_attachmentResponse(IntPtr l)
    {
        UnityEngine.InteractiveCloth o = (UnityEngine.InteractiveCloth)checkSelf(l);
        float v;

        checkType(l, 2, out v);
        o.attachmentResponse = v;
        return(0);
    }
 static public int get_isTeared(IntPtr l)
 {
     try {
         UnityEngine.InteractiveCloth self = (UnityEngine.InteractiveCloth)checkSelf(l);
         pushValue(l, self.isTeared);
         return(1);
     }
     catch (Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return(0);
     }
 }
 static public int constructor(IntPtr l)
 {
     try {
         UnityEngine.InteractiveCloth o;
         o = new UnityEngine.InteractiveCloth();
         pushValue(l, o);
         return(1);
     }
     catch (Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return(0);
     }
 }
 static public int constructor(IntPtr l)
 {
     LuaDLL.lua_remove(l, 1);
     UnityEngine.InteractiveCloth o;
     if (matchType(l, 1))
     {
         o = new UnityEngine.InteractiveCloth();
         pushObject(l, o);
         return(1);
     }
     LuaDLL.luaL_error(l, "New object failed.");
     return(0);
 }
 static public int set_attachmentResponse(IntPtr l)
 {
     try {
         UnityEngine.InteractiveCloth self = (UnityEngine.InteractiveCloth)checkSelf(l);
         float v;
         checkType(l, 2, out v);
         self.attachmentResponse = v;
         return(0);
     }
     catch (Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return(0);
     }
 }
 static public int set_mesh(IntPtr l)
 {
     try {
         UnityEngine.InteractiveCloth self = (UnityEngine.InteractiveCloth)checkSelf(l);
         UnityEngine.Mesh             v;
         checkType(l, 2, out v);
         self.mesh = v;
         return(0);
     }
     catch (Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return(0);
     }
 }
 static public int DetachFromCollider(IntPtr l)
 {
     try{
         UnityEngine.InteractiveCloth self = (UnityEngine.InteractiveCloth)checkSelf(l);
         UnityEngine.Collider         a1;
         checkType(l, 2, out a1);
         self.DetachFromCollider(a1);
         return(0);
     }
     catch (Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return(0);
     }
 }
Example #13
0
 static void InteractiveCloth_pressure(JSVCall vc)
 {
     if (vc.bGet)
     {
         UnityEngine.InteractiveCloth _this = (UnityEngine.InteractiveCloth)vc.csObj;
         var result = _this.pressure;
         JSApi.setSingle((int)JSApi.SetType.Rval, (System.Single)(result));
     }
     else
     {
         System.Single arg0 = (System.Single)JSApi.getSingle((int)JSApi.GetType.Arg);
         UnityEngine.InteractiveCloth _this = (UnityEngine.InteractiveCloth)vc.csObj;
         _this.pressure = arg0;
     }
 }
Example #14
0
// fields

// properties
    static void InteractiveCloth_mesh(JSVCall vc)
    {
        if (vc.bGet)
        {
            UnityEngine.InteractiveCloth _this = (UnityEngine.InteractiveCloth)vc.csObj;
            var result = _this.mesh;
            JSMgr.datax.setObject((int)JSApi.SetType.Rval, result);
        }
        else
        {
            UnityEngine.Mesh             arg0  = (UnityEngine.Mesh)JSMgr.datax.getObject((int)JSApi.GetType.Arg);
            UnityEngine.InteractiveCloth _this = (UnityEngine.InteractiveCloth)vc.csObj;
            _this.mesh = arg0;
        }
    }
 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);
     }
 }
 static public int AddForceAtPosition(IntPtr l)
 {
     try {
         int argc = LuaDLL.lua_gettop(l);
         if (argc == 4)
         {
             UnityEngine.InteractiveCloth self = (UnityEngine.InteractiveCloth)checkSelf(l);
             UnityEngine.Vector3          a1;
             checkType(l, 2, out a1);
             UnityEngine.Vector3 a2;
             checkType(l, 3, out a2);
             System.Single a3;
             checkType(l, 4, out a3);
             self.AddForceAtPosition(a1, a2, a3);
             return(0);
         }
         else if (argc == 5)
         {
             UnityEngine.InteractiveCloth self = (UnityEngine.InteractiveCloth)checkSelf(l);
             UnityEngine.Vector3          a1;
             checkType(l, 2, out a1);
             UnityEngine.Vector3 a2;
             checkType(l, 3, out a2);
             System.Single a3;
             checkType(l, 4, out a3);
             UnityEngine.ForceMode a4;
             checkEnum(l, 5, out a4);
             self.AddForceAtPosition(a1, a2, a3, a4);
             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 #17
0
    public void OnInitializeMesh()
    {
        rope.GenerateJointObjects();

        if (tube == null)
            tube = new RopeTubeRenderer(gameObject, true);

        mRender = gameObject.GetComponent<ClothRenderer>();
        if (mRender == null)
            mRender = gameObject.AddComponent<ClothRenderer>();

        mFilter = gameObject.GetComponent<InteractiveCloth>();
        if (mFilter == null)
            mFilter = gameObject.AddComponent<InteractiveCloth>();

        GenerateMesh();

        //if (useAutoTextureTiling)
        //    gameObject.GetComponent<ClothRenderer>().sharedMaterial.mainTextureScale = new Vector2(rope.Joints.Count / 2f, 1);

        if (gameObject.GetComponent<ClothRenderer>().sharedMaterial == null)
            gameObject.GetComponent<ClothRenderer>().sharedMaterial = (Material)Resources.Load("Materials/Rope", typeof(Material));
    }
 // Use this for initialization
 void Start()
 {
     ic = GetComponent<InteractiveCloth>() as InteractiveCloth;
 }
Example #19
0
    //    CharacterController charControl;
    // Use this for initialization
    void Start()
    {
        speed = 5.0f;
        jumpSpeed = 50f;//25000f;
        clothManip = GetComponent<InteractiveCloth>();
        clothRenderer = GetComponent<ClothRenderer>();
        embers = GetComponent<ParticleSystem>();
        charControl = GetComponent<CharacterController>();

        embers.Stop ();

        curTime = 0f; lavaMaxTime = 10f;
        center = transform.position;
        Vector3 centerPlane = transform.position + new Vector3 (0, 0, transform.localScale [2]/2.0f);
        grounded = isOnLava = true;
        //		float radius = vertices [0].
        //		int i = 0;
        //		for (i = 0; i < vertices.Length; i ++)
        //			if (vertices [i].x == center.x)
        ////				if (vertices [i].y == center.y)
        //					break;
        //		Vector3 centerPlane = center;
        //		centerPlane.x = vertices [i].x;
        r = center - centerPlane;
        glow = transform.Find ("Glow").GetComponent<Light>();
        originalColour = glow.color;
        //		center = GetComponent<MeshFilter>().mesh.
    }
	public ClothState( AmplifyMotionCamera owner, AmplifyMotionObjectBase obj )
		: base( owner, obj )
	{
		m_cloth = m_obj.GetComponent<InteractiveCloth>();
	}
 static public int get_isTeared(IntPtr l)
 {
     UnityEngine.InteractiveCloth o = (UnityEngine.InteractiveCloth)checkSelf(l);
     pushValue(l, o.isTeared);
     return(1);
 }
 public static int constructor(IntPtr l)
 {
     try {
         UnityEngine.InteractiveCloth o;
         o=new UnityEngine.InteractiveCloth();
         pushValue(l,o);
         return 1;
     }
     catch(Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return 0;
     }
 }
 static public int get_friction(IntPtr l)
 {
     UnityEngine.InteractiveCloth o = (UnityEngine.InteractiveCloth)checkSelf(l);
     pushValue(l, o.friction);
     return(1);
 }
 static public int get_tearFactor(IntPtr l)
 {
     UnityEngine.InteractiveCloth o = (UnityEngine.InteractiveCloth)checkSelf(l);
     pushValue(l, o.tearFactor);
     return(1);
 }
 static public int get_collisionResponse(IntPtr l)
 {
     UnityEngine.InteractiveCloth o = (UnityEngine.InteractiveCloth)checkSelf(l);
     pushValue(l, o.collisionResponse);
     return(1);
 }
 static public int get_pressure(IntPtr l)
 {
     UnityEngine.InteractiveCloth o = (UnityEngine.InteractiveCloth)checkSelf(l);
     pushValue(l, o.pressure);
     return(1);
 }
Example #27
0
 // Use this for initialization
 void Start()
 {
     cloth = GetComponent<InteractiveCloth> ();
 }
 static public int get_attachmentResponse(IntPtr l)
 {
     UnityEngine.InteractiveCloth o = (UnityEngine.InteractiveCloth)checkSelf(l);
     pushValue(l, o.attachmentResponse);
     return(1);
 }
 static public int get_density(IntPtr l)
 {
     UnityEngine.InteractiveCloth o = (UnityEngine.InteractiveCloth)checkSelf(l);
     pushValue(l, o.density);
     return(1);
 }
Example #30
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);
     }
 }