How to enable/disable arrays of entities with LinkedEntityGroup?

Hey,

within a chunk system i have several NativeArray with some entities being the root of a LinkedEntityGroup. I want to enable/disable them if the chunk changes visibility state.

I found those options:

  • EntityManager.AddComponent: provides batch but doesn’t obey LinkedEntityGroup
  • EntityManager.SetEnabled: obeys LinkedEntityGroup but doesn’t support batch

Is there a way to get a batched operation which takes account of LinkedEntityGroup?

Thanks!

LinkedEntityGroup is buffer. Buffers has AsNativeArray. EntityManager.AddComponent supports native array overload.

Yep, but that requires a call per entity. There seems to be no recursive method for this, at least i haven’t found one.

you can separate the entities that have LinkedEntityGroup from the ones that don’t, and batch vs SetEnabled accordingly.