Hopefully this is an easy enough question, but as a programmer I’m always wondering what Unity is actually doing behind the scenes. While reading through the API references, and just by trial-and-error, I’d guess the loop goes something like this:
- Instantiate new objects
- Call Update on all objects/components
- Do Physics (I’m sure there are a ton of substeps, like Fixed Updates and collision events, but I don’t have a clue how they are integrated)
- Destroy requested objects
- Render everything according to scene graph (like physics, I have no clue what the internals of this are)
- Call OnGUI on all objects/components
- Flip screen buffer, loop.
Thanks for any insight you guys can give me on this!