private void AddJointPhysics(int n) { SphereCollider col = _parts[n].AddComponent <SphereCollider>(); col.radius = ropeWidth; //SharMaterial Rigidbody rigid = _parts[n].AddComponent <Rigidbody>(); TubeShar tubeShar = _parts[n].AddComponent <TubeShar>(); // Debug.Log("_parts[n]= " + _parts[n]); Mesh mesh = new Mesh(); MeshFilter MF1 = _parts[n].AddComponent <MeshFilter>(); MeshRenderer MR1 = _parts[n].AddComponent <MeshRenderer>(); MR1.material = SharMaterial; // Debug.Log("MR1= " + MR1); MF1.mesh = mesh; OVRGrabbable myGrab1 = _parts[n].AddComponent <OVRGrabbable>(); tubeShar.Index = n; rigid.drag = ObjLinearDrag; rigid.angularDrag = ObjAngularDrag; rigid.mass = ObjMass; rigid.useGravity = false; }
private void AddJointPhysics(int n) { SphereCollider col = _parts[n].AddComponent <SphereCollider>(); col.radius = ropeWidth; Rigidbody rigid = _parts[n].AddComponent <Rigidbody>(); TubeShar tubeShar = _parts[n].AddComponent <TubeShar>(); tubeShar.Index = n; rigid.drag = ObjLinearDrag; rigid.angularDrag = ObjAngularDrag; rigid.mass = ObjMass; rigid.useGravity = false; }