Convert from JobComponentSystem to SystemBase

I currently have a system derived from JobComponentSystem with [DisableAutoCreation]. I Use IJobChunks and update manually in FixedUpdate().

Is there any guidance and/or documentation how I might approach converting this system over to SystemBase for Unity 2020.3 LTS?

I notice ArchetypeChunkComponentType is no longer available.

There isn’t really much difference between two, when you migrating.

ArchetypeChunkComponentType is replaced by HandleChunkComponentType, or something like that.

And you replace IJobChunks with IJobChunksEntities.

If your jobs are simple, you use Entities.ForEach.

You can just do it like this:

protected override void OnUpdate() {
    this.Dependency = OnUpdate(this.Dependency);
}

protected JobHandle OnUpdate(JobHandle inputDeps) {
    // Put code from old JobComponentSystem here
}

I also made an abstract base class for this:

public abstract class JobSystemBase : SystemBase {
    protected override void OnUpdate() {
        this.Dependency = OnUpdate(this.Dependency);
    }

    protected abstract JobHandle OnUpdate(JobHandle inputDeps);
}
2 Likes

dave you absolute legend. got an old project working i had all but written off. here’s a documentation link for that issue that was less helpful, just so i can contribute xD Upgrading from Entities 0.17 to Entities 0.51 | Entities | 0.51.1-preview.21

1 Like