Hello,
I have a scene where there are multiple meshes, and there is a job system to update the vertices of these meshes using the Entities.ForEach and ScheduleParallel() manner, which is working fine.
I also have another job to assign the updated vertices back to the meshes and recalc the normal as the following, but it only allows .WithoutBurst().Run(). Is there a way to run the mesh update job in a parallel way? thanks.
public class UpdateMeshVertex_JobSystem : SystemBase
{
protected override void OnUpdate()
{
Entities.ForEach(
(
in DynamicBuffer<Vertex_Element> vertex_buffer,
in RenderMesh RM
) =>
{
RM.mesh.SetVertices(vertex_buffer.ToNativeArray(Allocator.Temp).Reinterpret<Vector3>());
RM.mesh.RecalculateNormals();
})
.WithoutBurst().Run();
//.ScheduleParallel();
//error DC0019: Entities.ForEach uses ISharedComponentType RenderMesh. This is only supported when using .WithoutBurst() and .Run()
}
}