private void Destroy() { OnBrickDestroyed?.Invoke(this); Destroy(this.gameObject); }
private void OnCollisionEnter2D(Collision2D other) { //Asuming that only ball is moving and it will be the only collider to ever collide with brick. OnBrickDestroyed?.Invoke(this); gameObject.SetActive(false); }