using ComponentDataFromEntity inside local Functions

Im trying to reuse my code as I can and make it more readable.

i have a peace of code (30 lines) that im using in multiple switch cases in the same Job and this peace of code is using a ComponentDataFromEntity struct.

so is it Safe/Perfomant to create a local function and pass the ComponentDataFromEntity as a parametre ?

EDIT: Yes and there is no performance difference as far as I know.

https://docs.unity3d.com/Packages/com.unity.burst@1.2/manual/index.html#language-support

1 Like