在unity3d中物体发生碰撞的整个过程中,有几个阶段,分别列出对应的阶段函数
1个回答
展开全部
主要是三个阶段:1.Collider.OnCollisionEnter 进入碰撞,
OnCollisionEnter is called when this collider/rigidbody has begun touching
another rigidbody/collider.
当collider/rigidbody开始触动另一个rigidbody/collider时OnCollisionEnter被调用。
2.Collider.OnCollisionStay 逗留碰撞,
OnCollisionStay is called once per frame for every collider/rigidbody that is
touching rigidbody/collider.
每个collider/rigidbody触动rigidbody/collider,将在每帧调用OnCollisionStay。通俗的说,
一个碰撞器或刚体触动另一个刚体或碰撞器,在每帧都会调用OnCollisionStay,直到它们之间离开不接触。
3.Collider.OnCollisionExit 退出碰撞,
OnCollisionExit is called when this collider/rigidbody has stopped touching
another rigidbody/collider.
当 collider/rigidbody停止触动另一个 rigidbody/collider时,OnCollisionExit被调用。
OnCollisionEnter is called when this collider/rigidbody has begun touching
another rigidbody/collider.
当collider/rigidbody开始触动另一个rigidbody/collider时OnCollisionEnter被调用。
2.Collider.OnCollisionStay 逗留碰撞,
OnCollisionStay is called once per frame for every collider/rigidbody that is
touching rigidbody/collider.
每个collider/rigidbody触动rigidbody/collider,将在每帧调用OnCollisionStay。通俗的说,
一个碰撞器或刚体触动另一个刚体或碰撞器,在每帧都会调用OnCollisionStay,直到它们之间离开不接触。
3.Collider.OnCollisionExit 退出碰撞,
OnCollisionExit is called when this collider/rigidbody has stopped touching
another rigidbody/collider.
当 collider/rigidbody停止触动另一个 rigidbody/collider时,OnCollisionExit被调用。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询