2D native array ?

Jobs are currently accessing static 2D arrays because I can’t find a way to pass something like [int, NativeArray. It works but I’d rather do it the job way, what are the native data types and what are they for?

I’m not sure I completely follow what you’re asking for here.

Can you give us some simple pseudo code examples of what you’re trying to do and what you need?

that’s what I have, see how i use statics to access 2D array? I’d rather do it proper, how?

    struct ComputeInfluenceJob : IJobParallelFor
    {
        public void Execute(int i)
        {
            for (int j = 0; j < instance.settings.Length; j++)
            {
                //champandar
                int width = instance.size.x;
                int height = instance.size.y;

                float minInf = 0, maxInf = 0;
                float inf = instance.emitterValues[j, i];

Use a 1D array and index it as array[y * width + x]? That’s all that the 2D array is doing for you under the hood anyway.

8 Likes