I am trying to generate a Lookup Table on a static class, that I want to be able to access from inside ANY job.
This will never change during runtime, but needs to be generate on the fly:
Things I have tried:
Example 1 : Burst Compiler complains it cant access managed array
public readonly static int3[ ] LUT = generateLUT();
public generateLUT() { return new int3[ ]}
}```
Example 2 : Burst Compiler complains it cant access managed array
```public static class LUTHolder {
public readonly static int3[ ] LUT = new int3[ ];
static LUTHolder {
// generate the lut here
LUT[0] = new int3(0,1,0);
}
}```
Example3 : LUT is empty none of the values I put in are inside jobs, it looks like JOBS is copying the array while its empty.
```public static class LUTHolder {
public readonly static int3[ ] LUT = new int3[ ];
public static void Generate() {
// generate the lut here
LUT[0] = new int3(0,1,0);
}
}```
In my code the first thing I do before scheduling the job for the first time:
LUTHOLDER.Generate();
Things I dont want:
- I dont want to pass my LUT to all my JOBS (there are loads of LUTS and Jobs), unless there is 100% not another way.
- I dont want to pre-generate the LUT before compiling the game.
Thank you!