Manual Entity baking or more control over baking process

Problem: I have an asset in a custom binary format. I need to bake it into an ECS scene. The baking process creates 50-100K entities (static physics colliders). MeshCollider.Create is fairly slow and the process takes a couple of minutes, which is good enough since it should be a one-time process.

I have currently implemented it as a standard Baker following the documentation, but Unity is way too eager to rebake it and it becomes very annoying.

What I would like to do is either:

  1. Skip the whole GameObject → Entity baking pipeline and create entities from an editor script (they should be permanently added to a subscene and serialized/deserialized).

  2. Have more control over when the baking is triggered, for example add a button in the inspector that manually triggers the bake or have a way to manually mark the authoring GameObject dirty so the baking process picks it up.

How can I do that?

When is this annoying rebake that you’re talking about? If it’s after compilation, try putting the baker classes in separate assembly definitions. This way, it won’t trigger a rebake when code without assembly definition changes.

the baker gets called when i hit play and when i end play; as op said it’s super annoying when you’re baking lots of things. They shouldn’t have to re-bake every time