I changed scene with SceneManager.LoadScene(scene_index, LoadSceneMode.Single);
and all entities were destroyed, which include all system entities.
In the past (ECS 0.51), I didn’t see system entities be listing in DOTS Hierachy, now (ECS 1.2.3) I see them listing in Entities Hierachy, I wonder are they entities from the beginning or since ECS 1.x.
But in ECS 0.51, the entities didn’t get destroyed when changing scene. Is this new behaviour since ECS 1.x? How to prevent that? Or at least prevent all system entities from being destroyed?
System entities were introduced for 1.0 so you have a component-based way to store state related to a specific system that needs to be accessible to other systems, meant to supplant most places where you previously retrieved references to the system itself.
I’m not seeing that behavior when loading a scene with SceneManager, and I think this is not something that happens with normal use; mass destruction of system entities usually doesn’t trigger unless you specifically ask for it. Check if any of your code or any framework code calls EntityManager.DestroyAndResetAllEntities - this uses the universal query (EntityManager.UniversalQueryWithSystem) to destroy all the entities in the World, including system entities, and this action should not be done lightly.
1 Like
My bad, there is a EntityManager
→ DestroyAndResetAllEntities()
among the project. I should manage my project better.
So in ECS 0.51 it worked without any problem just because that time systems didn’t listed as entities.
Thank you.