December 2017
Beginner
290 pages
7h 17m
English
Hashtable, by default, isn't displayed in the Unity Inspector panel. You cannot simply look at the Inspector tab and preview all keys and values in your public member Hashtable.
We can do this in code, however. You know how to access a value and cast it. What if you are trying to access the value under a key that isn't stored in the Hashtable? Unity will spit out a null reference error and your program is likely to crash.
To check whether an element exists in the Hashtable, we can use the .Contains(object) method, passing the key parameter:

This determines whether the array contains the item and if ...
Read now
Unlock full access