Unity Framework

Hi guys-!
I have a question about unity framework.
normally we use script like below (basic template)

using UnityEngine;
using System.Collections;

public class helloworld : MonoBehaviour {

// Use this for initialization
void Start () {

}

// Update is called once per frame
void Update () {

}
}

Start, Update or OnEnable such methods would be called at proper time.
But I wonder, How could it be the methods are private?
It’s not virtual function, and maybe unity call it somewhere…

weird…

anybody help me!

I know that this could sound stupid but… Just take it like that , it works the functions get called.
Unity does not care if the function is public or private.
for the “proper time” you can take a look at this chart

1 Like

They are invoked by reflection.

1 Like

How does it works on iOS? I thought always that reflections re not available on iOS.

1 Like

Only some things are not available by reflection on iOS, like emitting new IL. Basic “passive” reflection, like GetType, GetFields, GetMethods and Invoke work fully on iOS.

2 Likes