void OnTriggerEnter2D(Collider2D other) { if (other.gameObject.CompareTag("Goal")) { Logics.AddScore(); Destroy(this.gameObject); } }
void OnTriggerEnter2D(Collider2D collision) { if (collision.gameObject.CompareTag("Player")) { Debug.Log("Player scored!"); Logics.AddScore(); Destroy(this.gameObject); } else if (collision.gameObject.CompareTag("Ground")) { Destroy(this.gameObject); } }