Unity Command Execution Order


Hello friends, in this post I will talk about which priority the built-in functions in Unity run with. In other words, we will discuss the lifecycle of commands in Unity.
The general execution order is as follows.
  1. Awake
  2. OnEnable
  3. Reset
  4. Start
  5. FixedUpdate
  6. OnTrigger
  7. OnCollision
  8. yield WaitForFixedUpdate
  9. OnMouse
  10. Update
  11. yield null
  12. yieldWaitForSeconds
  13. yield WWW
  14. yield StartCoroutine
  15. Late Update
  16. OnGUI
  17. yield WaitForEndOfFrame
  18. OnApplicationPause
  19. OnApplicationQuit
  20. OnDisable
  21. OnDestroy
The functions run from top to bottom in the order they are written, and you can also examine the execution priorities of all functions in the image below.

Unity FlowChart

In addition, you can examine these in more detail on the Unity Documentation page outside of the image.