I have an issue when changing scenes and exiting play mode. I add and modify a LinkedEntityGroup on a baked sub scene object. This is because I dynamically attach things to it during runtime. However, after doing this I am presented with this error:
System.ArgumentException: DestroyEntity(EntityQuery query) is destroying an entity which contains a LinkedEntityGroup with an entity not included in the query
I saw this bug report which marked this error as by design. So is there a workaround to this issue I am having? I would be extremely inconvenient to never be able to have sub scene entities with my system that modifies the LinkedEntityGroup.
Additionally, I did try to have a System where its OnDestroy cleans up the LinkedEntityGroup. But even having it run as the first thing in the InitializationGroup doesn’t work because it runs after the SubScene invokes Disable() which removes all scene entities.
Any ideas are welcome. Thank you.