0.6.0 How how to handle dependencies by yourself?

Hi,

so iam switching now to SystemBase and i wonder how i should refactor the code now. This is what i had before:

protected sealed override JobHandle OnUpdate(JobHandle inputDeps)
        {
            var handle = ScheduleEventJobs(inputDeps);
            var handle2 = ScheduleFlagBasedEvents(handle);
       
            return Update(handle2);
        }

Now i see that i have to use Dependency now, but i wonder how i can say dots that another returned dependency is the “latest” one:

protected sealed override void OnUpdate()
        {
            var handle = ScheduleEventJobs(Dependency);
            var handle2 = ScheduleFlagBasedEvents(handle);
       
            var handle3 = Update(handle2);

            Dependency = handle3;
        }

Is code like this, what we are supposed to do now?

Yes.

Entities.ForEach().Schedule() (or ScheduleParallel()) is basically this:
Dependency = Entities.ForEach().Schedule(Dependency);

Afaik, this is only available for Entities.ForEach lambdas, for Job structs you have to handle it manually.

1 Like

alright, thanks for the answer