Yeah that worked, only issue is it only works for current entities and doesn’t apply to any entities created later. But I guess I could write a system to keep track of the current hidden state and add this tag to any new entities each tick.
It is really strange/annoying that you can’t just disable the rendering systems though, I wonder why that is.
You could do both maybe, add FrozenSceneRendering tag to existing entities to stop their rendering and disable the RenderMeshSystemV2 to prevent new entities from being rendered, and revert this when you toggle the rendering.
In Hybrid Renderer V2, you could use DisableRendering tag component. Just add it to every entity. This will remove them from current render batches and will prevent them from getting to render batches anymore:
EntityManager.AddComponentData(EntityManager.UniversalQuery, new DisableRendering());
It’s slightly faster to add/remove DisableRendering to/from entities that have RenderMesh.
I can’t disable RenderMeshSystemV2 right after adding the tag, because RenderMeshSystemV2 needs to update once to process the tag!
Ahhh, I see, thanks!
@SebastianAaltonen I can’t find the DisableRendering tag, what namespace is that in? I assume I still need to apply this tag to any entity which is created after rendering has been disabled? Is this the best way to solve this problem or is there a better way?