Exemple #1
0
 private void OnCollisionEnter2D(Collision2D collision)
 {
     //Will not be destroyed if touching other fruit
     if (collision.gameObject.tag == "Wall")
     {
         msm.LoseLife();
         Destroy(gameObject);
     }
     else if (collision.gameObject.tag == "Player")
     {
         msm.IncrementScore();
         Destroy(gameObject);
     }
 }