When should i be using events

Hello, so i recently started using events and idk if what i am doing is good performance wise.

I have these units with a OnFire event and on these units there is a TakeDamage method that we subscribe to the OnFire event. And we then pass in a gameobject parameter so we know if it’s the target we are supposed to be hitting.

Is this better then just flat out calling the TakeDamage method on the enemy? Or is this just using too much CPU?

Thanks in advance!

It’s not about performance. It’s about design. Events are quite performant even when when used frequently, but the main reason to use them is to encapsulate your code so that there are a clear responsibilities (or even a single responsibility) for each class.