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