Is there an equivalent of the [ReadOnly] attribute inside an Entities.Foreach? In this sample code:
ComponentLookup<ExampleComponent> exampleComponentLookup = SystemAPI.GetComponentLookup<ExampleComponent>(true);
Entities.ForEach((Entity entity, ref InputRaycastData inputRaycastData) =>
{
if (!exampleComponentLookup.TryGetComponent(entity, out ExampleComponent exampleComponent)) return;
//Rest of the code
}).ScheduleParallel();
This code will throw an error because you are supposed to use a readonly componentlookup in a parallel job. In an IJobEntity or ParallelFor jobs, we could use the [ReadOnly] tag, but it's not possible here in Entities.Foreach.