Search Unity

How can I pass a multi-dimensional array to a job?

Discussion in 'Entity Component System' started by MintTree117, Mar 12, 2020.

  1. MintTree117

    MintTree117

    Joined:
    Dec 2, 2018
    Posts:
    340
    Essentially I need to pass a list of sorted lists into my job. To be specific, these are precomputed paths for pathfinding, so the lists need to be in order. So I don't think MultiHashMap will work.

    Can I pass an array of pointers? If so, how?
     
  2. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,780
    You could use entities with their buffers for that purpose as an examples.
    And then store array of entities.

    Alternatively, if you know that all arrays are fixed size and can not be bigger than n, then you simply create single array, with an index offset, for each set of data (paths).
     
    MintTree117 likes this.