void OnCollisionEnter2D(Collision2D other) { if (other.gameObject.CompareTag("Anglerfish")) { OnEaten?.Invoke(this); } }
private void OnTriggerEnter(Collider other) { var food = other.gameObject.GetComponent <IFood>(); if (food != null) { OnEaten?.Invoke(food); } }