首页 > 代码库 > Collider Collision Diff

Collider Collision Diff

Collision 中带有碰撞的信息,例如:速度和撞击到的点

 void OnCollisionEnter2D(Collision2D coll) 
{       foreach(ContactPoint contact in coll.contacts)
   {
         contact.point;//
   }    }
 

Collider是由影响的对象

 void OnTriggerEnter2D(Collider2D other) 
{      other.gameObject.transform.position;
}