- Home /
Why do "SendMessage" requires to have a receiver?
I feel like it should not. I mean, I like my stuff to be loosely coupled, but I cannot achieve this goal with such requirement. It doesn't allow me to write fully generics components.
Perhaps I might be missing something? Or there is some concept behind given requirement?
Answer by Jamora · Oct 08, 2013 at 06:39 PM
The documentation for GameObject.SendMessage clearly states that SendMessage takes a SendMessageOptions parameter, which you can use to tell Unity: "DontRequireReceiver".
As you clearly haven't read the docs, I'm forced to downvote. Do read the docs next time.
Thank. I found it after I submited my question, but could not cancel it, cause "Your question is reviewed by moderator" and I could not edit nor remove it.
Thanks nevertheless .