📜  oncollisionenter - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:05.635000             🧑  作者: Mango

代码示例3
OnCollisionEnter(Collision collision)
{
    ContactPoint contact = collision.contacts[0];
    Quaternion rotation = Quaternion.FromToRotation(Vector3.up, contact.normal);
    Vector3 position = contact.point;
    Vector3 relativeVelocity = collision.relativeVelocity;
}