November 2019
Intermediate to advanced
404 pages
12h 9m
English
As mentioned in Chapter 2, Scripting Strategies, dictionaries are used to map associations between two different objects, which are very quick at telling us whether a mapping exists, and if so, what that mapping is. It's common practice to map MonoBehaviour or ScriptableObject reference as the key of a dictionary, but this causes some problems. When the dictionary element is accessed, it will need to call into several derived methods of UnityEngine.Object, which both of these object types derive from. This makes element comparison and mapping acquisition relatively slow.
This can be improved by making use of Object.GetInstanceID(), which returns an integer representing a unique identification value for ...
Read now
Unlock full access