Type:SyncFieldDictionary
More actions
A SyncFieldDictionary is a type of Collection that maps data model values (string, int, float, etc) to data model values. Every key in a dictionary is unique and maps to a specific value, which doesn't have to be unique. For string and Uri, null may be used as a key. For Nullable types, null may not be used as a key.
If you are looking to map data model values to data model references (Slot, IAssetProvider, etc), see SyncRefDictionary.
SyncFieldDictionaries are synchronized between all players in a session, and their contents persist across duplicating and saving, like other fields. The contents of any SyncFieldDictionary cannot be viewed or edited using an inspector at this time, which is why an inspector on one says "Dictionaries not supported yet". This is misleading, as dictionaries may be read and edited with the use of specific nodes, see the Collections for a list of all the nodes which can work with collections.
A SyncFieldDictionary may be placed on a slot via attaching a ValueDictionary component to it and providing the appropriate types. From there, the SyncFieldDictionary on that component may be referenced statically like any other reference, or exposed via a Dynamic variable matching the dictionary's exact type.