docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    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

    Inheritance
    object
    Dictionary<TKey, TValue>
    SerializableDictionary<TKey, TValue>
    CapabilityDictionary
    Implements
    IDictionary<TKey, TValue>
    ICollection<KeyValuePair<TKey, TValue>>
    IReadOnlyDictionary<TKey, TValue>
    IReadOnlyCollection<KeyValuePair<TKey, TValue>>
    IEnumerable<KeyValuePair<TKey, TValue>>
    IDictionary
    ICollection
    IEnumerable
    IDeserializationCallback
    ISerializable
    ISerializationCallbackReceiver
    Inherited Members
    Dictionary<TKey, TValue>.Add(TKey, TValue)
    Dictionary<TKey, TValue>.Clear()
    Dictionary<TKey, TValue>.ContainsKey(TKey)
    Dictionary<TKey, TValue>.ContainsValue(TValue)
    Dictionary<TKey, TValue>.EnsureCapacity(int)
    Dictionary<TKey, TValue>.GetEnumerator()
    Dictionary<TKey, TValue>.GetObjectData(SerializationInfo, StreamingContext)
    Dictionary<TKey, TValue>.OnDeserialization(object)
    Dictionary<TKey, TValue>.Remove(TKey)
    Dictionary<TKey, TValue>.Remove(TKey, out TValue)
    Dictionary<TKey, TValue>.TrimExcess()
    Dictionary<TKey, TValue>.TrimExcess(int)
    Dictionary<TKey, TValue>.TryAdd(TKey, TValue)
    Dictionary<TKey, TValue>.TryGetValue(TKey, out TValue)
    Dictionary<TKey, TValue>.Comparer
    Dictionary<TKey, TValue>.Count
    Dictionary<TKey, TValue>.this[TKey]
    Dictionary<TKey, TValue>.Keys
    Dictionary<TKey, TValue>.Values
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.XR.CoreUtils.Collections
    Assembly: Unity.XR.CoreUtils.dll
    Syntax
    [Serializable]
    public class SerializableDictionary<TKey, TValue> : Dictionary<TKey, TValue>, IDictionary<TKey, TValue>, ICollection<KeyValuePair<TKey, TValue>>, IReadOnlyDictionary<TKey, TValue>, IReadOnlyCollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>, IDictionary, ICollection, IEnumerable, IDeserializationCallback, ISerializable, ISerializationCallbackReceiver
    Type Parameters
    Name Description
    TKey

    The dictionary key.

    TValue

    The dictionary value.

    Constructors

    SerializableDictionary()

    Initializes a new instance of the dictionary.

    Declaration
    public SerializableDictionary()

    SerializableDictionary(IDictionary<TKey, TValue>)

    Initializes a new instance of the dictionary that contains elements copied from the given input dictionary.

    Declaration
    public SerializableDictionary(IDictionary<TKey, TValue> input)
    Parameters
    Type Name Description
    IDictionary<TKey, TValue> input

    The dictionary from which to copy the elements.

    Properties

    SerializedItems

    The serialized items in this dictionary.

    Declaration
    public List<SerializableDictionary<TKey, TValue>.Item> SerializedItems { get; }
    Property Value
    Type Description
    List<SerializableDictionary<TKey, TValue>.Item>

    Methods

    OnAfterDeserialize()

    See ISerializationCallbackReceiver Load this dictionary from the SerializedItems list.

    Declaration
    public virtual void OnAfterDeserialize()

    OnBeforeSerialize()

    See ISerializationCallbackReceiver Save this dictionary to the SerializedItems list.

    Declaration
    public virtual void OnBeforeSerialize()

    Implements

    IDictionary<TKey, TValue>
    ICollection<T>
    IReadOnlyDictionary<TKey, TValue>
    IReadOnlyCollection<T>
    IEnumerable<T>
    IDictionary
    ICollection
    IEnumerable
    IDeserializationCallback
    ISerializable
    ISerializationCallbackReceiver

    Extension Methods

    DictionaryExtensions.First<TKey, TValue>(Dictionary<TKey, TValue>)
    DictionaryExtensions.First<TKey, TValue>(Dictionary<TKey, TValue>)
    CollectionExtensions.Stringify<T>(ICollection<T>)
    CollectionExtensions.Stringify<T>(ICollection<T>)
    In This Article
    • Constructors
      • SerializableDictionary()
      • SerializableDictionary(IDictionary<TKey, TValue>)
    • Properties
      • SerializedItems
    • Methods
      • OnAfterDeserialize()
      • OnBeforeSerialize()
    • Implements
    • Extension Methods
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)