Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Resolved NativeHashSet

Discussion in 'Scripting' started by crazyguy90, Dec 31, 2020.

  1. crazyguy90

    crazyguy90

    Joined:
    Aug 27, 2015
    Posts:
    12
    Hello everyone,

    I've read about NativeHashSets in the documentation: https://docs.unity3d.com/Packages/c...14/api/Unity.Collections.NativeHashSet-1.html

    When I try to use NativeHashSet it doesn't seem to be implemented yet. I have installed the latest version of Unity.Collections available, but that is maybe not the correct version as the documentation says it's version 0.14.0-preview.16? But even with the latest beta build of unity I can't get it from the package manager. How can I use NativeHashSets then? Am I missing something?

    Happy new year!
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,517
    How are you inferring this? Do you get a System.NotImplementedException?
     
  3. crazyguy90

    crazyguy90

    Joined:
    Aug 27, 2015
    Posts:
    12
    I get the error
    "...CS0246: The type or namespace name 'NativeHashSet<>' could not be found (are you missing a using directive or an assembly reference?)"
    I'm using
    using Unity.Collections;
    and all the other stuff like NativeArray, NativeList and such is working. Am I missing something?
     
  4. crazyguy90

    crazyguy90

    Joined:
    Aug 27, 2015
    Posts:
    12
    Just if somebody is interested: Edit > Preferences > External Tools > Regenerate Project Files did the trick.
     
  5. wechat_os_Qy03rpKug13760S5SJsjtYunk

    wechat_os_Qy03rpKug13760S5SJsjtYunk

    Joined:
    Dec 25, 2022
    Posts:
    1
    thanks! it worked! I changed the editor into Visual Studio and regenerated project files then restarted.