I realized I have some hybrid systems and I wanted to get rid of ComponentArray. However, I can’t find an appropriate ArchetypeChunk*Type that can be used for MonoBehaviour components. I ended up using ComponentGroup.GetComponentArray().
Use GetArchetypeChunkComponentType to get the type, then use GetComponentObjects from the chunk. Example for Rigidbody:
ArchetypeChunkComponentType<Rigidbody> rigidbodyRO = GetArchetypeChunkComponentType<Rigidbody>(true);
foreach (ArchetypeChunk chunk in chunks)
{
ArchetypeChunkComponentObjects<Rigidbody> rigidbodyArray = chunk.GetComponentObjects(rigidbodyRO, EntityManager);
}
You can then index the array as normal.