I only have a little experience with Unity3D, but I noticed that classes that come from MonoBehaviour can contain functions with predefined signatures that will be called in a special way. For example, if I write:
void Update() {
this method will be called every frame.
I assume that inside Unity there is some kind of infinite loop that calls the Update method for every frame for every object on the scene. But how does he know that the object actually implements the implementation of the Update method? It would be clear if Update was an override for a method in the MonoBehaviour class, but judging by the syntax (and the fact that you can implement such methods with any access modifier), this is not the case. Is there some kind of reflection magic?
source share