Using HashSet in Unity

I want to use System.Collections.Generic.HashSet in my Unity project, but it won't compile. I Checked and HashSet is in system.core.dll, rather than mscorlib.dll or system.dll. Do we not have access to System.Core.dll?

I could always use a Dictionary and just set the values to true if they're in the set, and null or false if they're not, but a HashSet would be more ideal.

As Soren mentions, you can't have that in Unity 2.x since the collection is only available in more recent versions of .Net. You are unlikely to get it before version 3, as it might mean breaking available games.

You may want to consider the C5 Generic Collection Library, a very well designed open source library containing more useful generic collections that you shake an iterator at (including HashSet and HashBag). Among many other great features, it's exceedingly well documented.

For now, Unity only support up to .NET 2.0 features. HashSet(T) is a .NET 3.5 feature.

Which version of Unity? Unity iPhone doesn't support generics as it's an older version of Mono/.NET.