Augmented Reality Game Development by Micheal Lanham

Augmented Reality Game Development by Micheal Lanham

Author:Micheal Lanham
Language: eng
Format: epub, azw3
Publisher: Packt Publishing


CollisionReaction: This handles the messy details of what happens when an object collides with it; the code is fairly straightforward: public void OnCollisionReaction(GameObject go, Collision collision) { ContactPoint contact = collision.contacts[0]; Quaternion rot = Quaternion.FromToRotation(Vector3.up, contact.normal); Vector3 pos = contact.point; if (particlePrefab != null) { var particle = (Transform)Instantiate(particlePrefab, pos, rot); Destroy(particle.gameObject, destroyParticleDelaySeconds); } if (destroyObject) { Destroy(go, destroyObjectDelaySeconds); } collisionEvent.Invoke(gameObject, collision); }



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.