Search Unity

Feedback JobComponentSystem OnDestroy() order

Discussion in 'Entity Component System' started by Deleted User, Jul 26, 2019.

  1. Deleted User

    Deleted User

    Guest

    Is there anyway to specify destroy order of systems? Currently the systems are destroyed in reverse of their construction. It would be nice to have such feature so an Entity's system state data resources can be freed in needed order.

    Thank you.
     
  2. elcionap

    elcionap

    Joined:
    Jan 11, 2016
    Posts:
    138
    AFAIK there is no way to directly control the destroy order.
    If you want to control the order only when unloading the game you can use PlayerLoopManager.RegisterDomainUnload with a lower order (the default world creator uses 10000) to access all systems before the dispose. Unfortunately I can't help beyond this.

    []'s
     
    Deleted User likes this.
  3. Deleted User

    Deleted User

    Guest

    I am using it as well with a higher order. Probably the lower one will help me to organize unloading based on the priorities. Thank you.