Ejemplo n.º 1
0
    void Update()
    {
        int i = 0;

        foreach (var item in cloth)
        {
            if (gravity)
            {
                item.GetComponent <PointMass> ().AddForce(new Vector3(0, -9.8f, 0));
            }
            newVerts [i++] = item.transform.position;
        }

        if (Input.GetKeyDown(KeyCode.G))
        {
            gravity = !gravity;
        }


        mm.verts = newVerts;
        mm.setMesh();
    }