Callbacks system
Options
Comments
-
I think you are talking about the Photon Unity Networking package for Unity3d? If so: Just have a look
In this case, we actually didn't implement the call ourselves but used SendMonoMessage implemented by Unity. I think it's some variation of Invoke(), which is part of the DotNet framework.0 -
I was guessing you'd have implemented something specific because SendMessage is known to be slow and expensive cpu-wise. I was thinking about something more like Update, Awake, Start etc, from Unity, and I don't know how those work behind. Calling an Update using SendMessage would not be much efficient if called every frame.0
-
I guess Update and SendMessage work much the same but they cache all the MethodInfo instances they need to call Update regularly. This is something they can't really do when calling arbitrary named methods in SendMonoMessage though.
Example: We cache the OnSerializePhotonView methods we have to call often but we don't cache the instances of classes for the other callbacks we rarely do.0