Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. We are looking for feedback on the experimental Unity Safe Mode which is aiming to help you resolve compilation errors faster during project startup.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

NativeMultiHashMap

Discussion in 'Data Oriented Technology Stack' started by kaffiene, Oct 7, 2018.

  1. kaffiene

    kaffiene

    Joined:
    May 26, 2013
    Posts:
    21
    NativeMultiHashMap maps a key against multiple values. Its remove method removes a key (and therefore every value associated). Is there a mechanism to just remove a single value associated with a key?

    Is there any documentation for this class anywhere? I did a lot of Googling but all my ECS/Unity searches seem to go back to the same few introductory articles which aren't about NativeMultiHashMap :eek:)

    Cheers!

    Peter
     
    Last edited: Oct 8, 2018
  2. capyvara

    capyvara

    Joined:
    Mar 11, 2010
    Posts:
    79
    There's a method to remove a value based on a iterator which can be used to remove a single value:

    public void Remove(NativeMultiHashMapIterator<TKey> it)
     
    recursive likes this.
  3. kaffiene

    kaffiene

    Joined:
    May 26, 2013
    Posts:
    21
    Brilliant, thank you
     
unityunity