[C# only, please]
Sorry if this is really simple, but since I’m starting out, I probably missed something.
Lets say I have a EnemyDetector script. It detects all GameObjects within a certain radius, and checking if they have the “Enemy” tag.
What I want is something like a delegate (I know a little of what they can do, but after some research I don’t know if they can do this) calls all methods subscribed to it, but passing a Transform (or any other component attached to the detected GameObject) of the Enemy while calling it.
Even though I could just do this by simple calling the methods like usual, I feel like there must be a better way with a such a powerful language (C#).
Resuming the sentence above, I want to make my code look readable and a little optimized, not a mess.
Thanks to anyone that replies to this.