I wanted an excuse to try disabling and enabling components of a GameObject dynamically. I came up with the idea of implementing the dreaded Elephant.
I first tried to implement the Elephant’s field of anger using two BoxColllider2Ds. That didn’t work out, because there’s no way to determine which BoxCollider2D was triggered in the callback. This meant that Elephants could be injured by a bullet intersecting its much larger field of anger.
The solution that ended up working was to implement a check against the player using Vector2.Distance.