private void OnTriggerEnter(Collider other) { if (other.tag == "Ball") { if (!BallController.DestroyBall(other.gameObject)) { PlayerController.Instance.Life--; } } }
private void OnTriggerEnter2D(Collider2D other) { BallController ballToRemove = other.GetComponent <BallController>(); if (ballToRemove) { ballToRemove.DestroyBall(); } else if (other.GetComponent <Collectible>()) { Destroy(other); } }