Search Unity

Request more elegant way to setup execution order of Systems

Discussion in 'Entity Component System' started by optimise, Mar 21, 2018.

  1. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,129
    Referring to https://forum.unity.com/threads/execution-order-of-systems.522666/, from I understand so far the execution order of Systems only can set at the individual system with the attribute. I don't think put attribute to individual system is scalable when the system growing bigger and bigger. I think it should have one central place to setup execution order of all Systems that will make it super easy to see and modify the execution order.

    upload_2018-3-21_22-54-12.png
     
  2. Ziboo

    Ziboo

    Joined:
    Aug 30, 2011
    Posts:
    356
    Actually attribute is only to force the ordering in case you want really specific order, on in a different UpdateLoop.
    The system actually order systems automatically based on dependency by itself, so it does all the job for you.
     
    Krajca likes this.
  3. mike_acton

    mike_acton

    Unity Technologies

    Joined:
    Nov 21, 2017
    Posts:
    110
    You can use named Barriers (or even your own empty systems) to create synchronization points you can order against. (e.g. "EndOfFrame" "UpdatePhase1" or whatever) - I agree that without creating some shared points you can work against, managing system dependencies would quickly become a mess to support. But with a few sync points all your systems know about you can mitigate that pretty well.