Rei
1
How much real difference is there?
The unity reference says "leave out the collisionInfo parameter as this avoids unneccessary calculations", but what does it really mean by collisionInfo parameter?
http://unity3d.com/support/documentation/ScriptReference/Collider.OnCollisionEnter.html
I am assuming if I don't access the contactPionts and relativeVelocity properties of the Collision class there's not much of a difference?
(as each of them are going to be a function call that cost some heavy calculation...)
Am I getting this right?
Skjalg
2
It is referring to the fact that you can create two kinds of OnCollisionEnters in your MonoBehaviour.
The Costly One:
void OnCollisionEnter(Collision collision)
{
Debug.Log("Collided!");
}
... And the Low Performance:
void OnCollisionEnter()
{
Debug.Log("Collided!");
}
The second one is low performance, because the Unity3d engine doesn't need to do a lot of calculations for you in order to provide the Collision parameter :)
If all you need to know is what the other object was you can make one or both of them Triggers and use OnTriggerEnter(Collider). You can use the Collider to get at the game object that’s doing the colliding with the trigger.