Entities.Foreach 'in' parameter in lambda shows ReadWrite dependency

I started to convert the old GetEntityQuery + explicit Job declaration structure to the new Entities.Foreach + With builder version and I noticed that even though the lamba parameter has ‘in’ modifier the EntityDebugger window still shows that the component has ReadWrite dependency.

Is that the correct behaviour?
Should we keep using the explicit version when we want a ReadOnly behaviour?

Picture was taken from the Samples/HelloCube/1. Foreach script.

I believe it’s a bug with the Entity Debugger. If you check the generated code for the job with IL Spy it will have the ReadOnly attribute in the second parameter.

3 Likes