Random generation in subscenes

I am using an asset that generates random three d levels at runtime.
I am trying to figure out how to take the level and have it be part of the subscene

If this asset generates GameObjects at runtime, unless it can also generate them in the editor which can be saved in a scene, then unfortunately the asset is incompatible with ECS.

If you really really want to do this at runtime, you can create renderer/collider entities based on the generated GameObjects: Runtime entity creation | Entities Graphics | 1.0.16

Keep in mind that this won’t be very performant, and it kinda misses the point of ECS, but it’s technically viable if you want to re-use that asset and you aren’t constrained by slow level loading.

As mentioned above, you could save yourself a lot of trouble by pre-generating your levels in the editor and saving them in subscenes. Obviously, that’s less flexible… and in turn it kinda misses the point of procedural generation.

A few options:

  1. Break down assets into prefabs, bake prefabs, use prefabs to generate levels.
  2. Use runtime authoring for the required entities, it won’t be part of the subscene obviously.