Search Unity

Initialization execution order for MonoBehaviours and ComponentSystems

Discussion in 'Entity Component System' started by brunocoimbra, Nov 2, 2019.

  1. brunocoimbra

    brunocoimbra

    Joined:
    Sep 2, 2015
    Posts:
    679
    Made a few tests and seems like the execution order is:

    ComponentSystem.OnCreate()
    MonoBehaviour.Awake()
    MonoBehaviour.Start()
    ComponentSystem.StartRunning()

    But as I couldn't find any official info about that I wanted to question around before making any assumptions.

    I know that ECS is still in preview but I think it would be amazing to have a page similar to that one https://docs.unity3d.com/Manual/ExecutionOrder.html which includes the basic ECS stuff in the equation.

    Sorry if it was lack of research, have been following the DOTS forum for a while and didn't notice anyone mentioning that before, if anyone already did then a link to that would be highly appreciated!

    PS: I do know that the best approach is to not rely into execution order like that but I am targeting into slowly integrate hybrid ECS into my huge codebase and having that info would save to both me and my team some headaches.
     
    MNNoxMortem and ju_my like this.
  2. ju_my

    ju_my

    Joined:
    Mar 7, 2017
    Posts:
    23
    I totally agree it would be very appreciable to have such an execution List
     
    brunocoimbra likes this.