How do I convert a dictionary keys' to array in Unity 4.3? (other than manually, of course)
This solution doesn't seem to work, and I'm puzzled about why.
Code:
private Dictionary<int,Client> uid2Client;
public static int[] uidList
{
get
{
return instance.uid2Client.Keys.ToArray();
}
}
Error:
Assets/sources/ClientServer.cs(144,57): error CS1061: Type `System.Collections.Generic.Dictionary<int,Client>.KeyCollection' does not contain a definition for `ToArray' and no extension method `ToArray' of type `System.Collections.Generic.Dictionary<int,Client>.KeyCollection' could be found (are you missing a using directive or an assembly reference?)