1MyFunction function is called using the following line of code:
sceneObject.AddComponent<MyScript>().MyFunction();
The execution order in the script MyScript is the following:
sceneObject.AddComponent<MyScript>().MyFunction();
The execution order in the script MyScript is the following: