#Is the [ReadOnly] attribute no longer required in IJobEntity ECS jobs?

1 messages · Page 1 of 1 (latest)

south kettle
#

In the example project MiscellaneousEntities [ReadOnly] seems to be neglected, so I was wondering if anything changed.

proud scarab
#

i dont see anywhere

south kettle
#

shouldn't is be [ReadOnly] public float Delta; on line 31?
Delta isn't modified in the job.

proud scarab
#

[ReadOnly] is really only used for Native Containers

#

since Delta is just a value type float changing it in the job is safe
(it is localised to that thread since it is a copy)

#

if you wanted to change that value and use it back on the mainthread after the job you'd use NativeReference<float>

#

and depending on use it might not be safe to change in parallelised job, i think you'd need to disable the safeties