void Start() { part.setInverseMassWithMass(0.5f); part.affectedByGravity(true); part.checkGravity(); testReg.add(part, grav); _gobject = Instantiate(gobject, pos.convertToVector3(), Quaternion.identity, gameObject.transform) as GameObject; }
// Use this for initialization void Start() { part1.setPosition(transform.position.x, transform.position.y, transform.position.z); part2.setPosition(transform.position.x, transform.position.y + 1.5f, transform.position.z); //same position as green ball but not the positon of green ball //part1.setMass (25); part1.setInverseMassWithMass(0.5f); print("Part1 inverse mass: " + part1.getInverseMass()); part1.affectedByGravity(true); //setGravity (0, -1, 0); //part1.setVelocity (12, 10, -1); //part1.setAcceleration (0, 20, 0); part1.checkGravity(); //part1.setAcceleration ((float)gravity.getComponentX(), (float)gravity.getComponentY(), (float)gravity.getComponentZ()); /* * You could mess around with creating fireworks later page 84 in millington though not in the current form */ }
//static ParticleDrag drag = new ParticleDrag (0.01f,0.01f); void Start() { part1.setPosition(GameObject.Find("Particle1").transform.position.x, GameObject.Find("Particle1").transform.position.y, GameObject.Find("Particle1").transform.position.z); part2.setPosition(GameObject.Find("Particle2").transform.position.x, GameObject.Find("Particle2").transform.position.y, GameObject.Find("Particle2").transform.position.z); //print ("Positions set"); part1.setInverseMassWithMass(0.5f); part1.affectedByGravity(true); part1.checkGravity(); part2.setInverseMassWithMass(0.5f); part2.affectedByGravity(true); part2.checkGravity(); MyForceReg.add(part1, gravity1); MyForceReg.add(part2, gravity2); //MyForceReg.add (part1, drag); //MyForceReg.add (part2, drag); }