How are dependencies automatically managed in system base?

if you were to schedule two jobs in one System.OnUpdate, how would the dependency implicitly be handled between them, like case 1 or case two?

// case 1
JobHandle dep1 = Entities.Schedule(Dependency);
JobHandle dep2 = Entities.Schedule(dep1);
Dependency = dep2;


// case 2
JobHandle dep1 = Entities.Schedule(Dependency);
JobHandle dep2 = Entities.Schedule(Dependency);
Dependency = JobHandle.CombineDependencies(dep1, dep2);

in SystemBase when code gen happens, for dependencies all that is happening is

this.Entities.ForEach().Schedule()
this.Entities.ForEach().Schedule()

is changed into

this.Dependency = this.Entities.ForEach().Schedule(this.Dependency)
this.Dependency = this.Entities.ForEach().Schedule(this.Dependency)

so effectively case1

4 Likes