Class SerializableDictionary<TKey, TValue>
A dictionary class that can be serialized by Unity. Inspired by the implementation in http://answers.unity3d.com/answers/809221/view.html
Implements
IDictionary<TKey, TValue>
ICollection<KeyValuePair<TKey, TValue>>
IReadOnlyDictionary<TKey, TValue>
IReadOnlyCollection<KeyValuePair<TKey, TValue>>
IEnumerable<KeyValuePair<TKey, TValue>>
Inherited Members
Namespace: Unity.XR.CoreUtils.Collections
Assembly: solution.dll
Syntax
[Serializable]
public class SerializableDictionary<TKey, TValue> : Dictionary<TKey, TValue>, IDictionary<TKey, TValue>, ICollection<KeyValuePair<TKey, TValue>>, IDictionary, ICollection, IReadOnlyDictionary<TKey, TValue>, IReadOnlyCollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>, IEnumerable, ISerializable, IDeserializationCallback, ISerializationCallbackReceiver
Type Parameters
Name | Description |
---|---|
TKey | The dictionary key. |
TValue | The dictionary value. |
Constructors
Name | Description |
---|---|
SerializableDictionary() | Initializes a new instance of the dictionary. |
SerializableDictionary(IDictionary<TKey, TValue>) | Initializes a new instance of the dictionary that contains elements copied from the given
|
Properties
Name | Description |
---|---|
SerializedItems | The serialized items in this dictionary. |
Methods
Name | Description |
---|---|
OnAfterDeserialize() | See ISerializationCallbackReceiver Load this dictionary from the SerializedItems list. |
OnBeforeSerialize() | See ISerializationCallbackReceiver Save this dictionary to the SerializedItems list. |