private void OnCollisionEnter2D(Collision2D collision)
 {
     if (collision.gameObject.tag == "Enemigo")
     {
         Destroy(collision.gameObject);
         Destroy(this.gameObject);
         Puntaje.AddPoints(10);
         Debug.Log(Puntaje.GetPoint());
     }
 }
Пример #2
0
 private void OnCollisionEnter2D(Collision2D collision)
 {
     if (collision.gameObject.tag == "Obstaculo" || collision.gameObject.tag == "Enemigo")
     {
         muerte = true;
     }
     if (collision.gameObject.tag == "Coins")
     {
         coins = true;
         Destroy(collision.gameObject);
         _audioSource.PlayOneShot(AudioCoins);
         Puntaje.AddPoints(5);
         Debug.Log(Puntaje.GetPoint());
     }
 }