예제 #1
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.gameObject.name == "Sanic")
     {
         Puntaje.AddPoints(pointsToAdd);
         Destroy(gameObject);
         Debug.Log(pointsToAdd);
     }
 }
예제 #2
0
 private void OnCollisionEnter2D(Collision2D collision)
 {
     if (collision.gameObject.layer == 3)
     {
         Destroy(collision.gameObject);
         Destroy(this.gameObject);
         Puntaje.AddPoints(10);
         Debug.Log(Puntaje.GetPoint());
     }
 }