Is there a fast way to toggle if a RenderMesh is active/in-active per entity other than adding and removing the shared component RenderMesh or rewriting my own version of RenderMesh? I have thousands of selectable objects. These selectable objects each have a RenderMesh highlight graphic being toggled while a selection box is being dragged over the screen. It doesn't feel right to add/remove SharedComponents in large numbers from frame to frame in this situation?
Thanks, that does work. So instead of Add/Remove RenderMesh I can Add/Remove a Disabled tag component. Is adding/removing tag components a reasonable thing to do in this situation? Do you know more of what is going on behind the scenes when this is done in terms of memory layout?
From my limited understanding, the Disabled component will keep the affected entity away from the RenderSystem and TransformSystem. Adding any component will necessarily change the entity's archetype, I believe.
If I remember correctly, they are planning to make it so that adding tag components (components with no data) doesn't require changing its archetype.