Hi, right now I’m designing a job system layout. And I want to be sure that those systems execute exactly in a determined order.
I will put a simple example to make my question clearer.
let’s suppose that I have three systems:
-SysA: reads from component X and writes to component Y.
-SysB: reads from component Y and writes to Component Z.
-SysC: reads from component Y and Z and writes to component X.
now, in this case, I will need to run all of the SysA jobs then SysB jobs and finally the SysC jobs.
So my question is, what are the methods to handle job dependencies between different job component systems?
Ok, I get that but I still don’t understand where and how the dependencies declared in the querries are shared between systems.
If I’m not mistaken, for what I’ve read, I believe that the dependencies of each system are shared to the rest of systems by the return value in the Update() function of the JobComponentSystem. Please correct me if I’m wrong because I’m not sure.
A system keeps track of the queries used, and binds the returned JobHandle to them. The JobHandle knows nothing about the ECS types, and the ECS mechanism has no way of knowing which jobs the ECS types were used, so Unity needs both halves to sort out the dependencies.