Current its very complicated to use this when i want runtime data. I have to do something like this.
Would be great to have a method to just pass mesh, material and submeshIndex instead of that big sharedC component array.
It seems the only method, that is available to use on runtime, to add something to an entity, correct?
var renderMeshInfo = MaterialMeshInfo.FromRenderMeshArrayIndices(0, 0, submeshIndex: (sbyte)submeshIndex);
RenderMeshUtility.AddComponents(entity, EntityManager, desc, renderMesh, renderMeshInfo);
// Afterwards we resolve it to runtime
EntityManager.SetComponentData(entity, new MaterialMeshInfo(EntityManager.World.Convert(material), EntityManager.World.Convert(mesh), submeshIndex: (sbyte)submeshIndex));
EntityManager.RemoveComponent<RenderMeshArray>(entity);