RenderMesh is Shared Component. Hence I can not check in same manner, as component data from entity, or buffer from entity.
I change renderer in jobs of RenderMesh shared component.
ecb.SetSharedComponent <RenderMesh> ( jobIndex, meshEntity, updatedMesh ) ;
Mostly works. But with large amount of entities, in multithreaded jobs, I see occasionaly error
ArgumentException: A component with type:RenderMesh has not been added to the entity.
I am sure there should exists. I even add tag custom tag, to validate existence. Yet entity command buffer don’t like it. My only suspicion is, such entities are destroyed in same frame, in other job. However, calling job Complete (), technically should resolve the issue. But is not.
So now I have run out of ideas, how to solve that.
Any thoughts?