OnCollisionExit2D









How do I use On Collision Exit2 D
Below are practical examples compiled from projects for learning and reference purposes

Featured Snippets


File name: BlockScript.cs Copy
23     void OnCollisionExit2D(Collision2D col)
24     {
25         gameObject.SetActive(false);
26         GameManager.Score += 20;
27         GameManager.BlocksAlive--;
28     }
File name: Animal.cs Copy
419         public void OnCollisionExit2D(Collision2D otherCollision)
420         {
421             if (otherCollision.gameObject.name == MapObjectNames.GroundObject)
422             {
423                 if (state == RUN)
424                 {
425                     state = JUMPING;
426                 }
427             }
428         }

OnCollisionExit2D 150 lượt xem

Gõ tìm kiếm nhanh...