Auto generate Baker authoring flow?

I like the Baker authoring concept in DOTS 1.0. It certainly make the conversion from gameobject to ECS component more easily.

But I found I need to rewrite very similar baker code for each MonoBehaviour over and over again.

Will there a plan for improve this part?. Like auto generate baker code from attributes?
Not sure if its possible. Just curious.

Similar question

If Unity were to support this (like they did with GenerateAuthoringComponent), I think they’d need to support a robust way to maintain the data if you decide to make your own baker later.

On my project, it happened quite often that GenerateAuthoringComponent was used for quick programming. However, later, when the authoring needs inevitably diverged from the runtime needs, a custom authoring component would be created, GenerateAuthoringComponent would be removed and the data would be lost.

That’s why we decided internally to ban GenerateAuthoringComponent.

Good case
because of thins I want to use IComponentData Directly without any authoring component

if it will change from runtime data I just create new component for runtime data and write custom baker nothing will be lost

Actually the data you have on a GameObject and anything this GameObject is assigned to unless you take particular care to replicate the exact MonoBehaviour for authoring in the same file the [GenerateAuthoringComponent] is in, will be lost. It is very fragile, and this as well as many other reasons are why it’s gone.

We have a better alternative that makes it easier to scaffold into a full Authoring+Baker combo, which is outlined here https://discussions.unity.com/t/895783/5

As it happens, it seems you replied in that thread already, Jes28 :slight_smile:

1 Like