Skip to main content

Class SerializableDictionary<TKey, TValue>

A generic serializable dictionary implementation compatible with Unity's serialization system. Stores key-value pairs in a serializable list, and synchronizes with the base dictionary during serialization and deserialization.

[Serializable]
public class SerializableDictionary<TKey, TValue> : Dictionary<TKey, TValue>

Type Parameters​

NameTypeDescription
TKeyThe type of keys in the dictionary.
TValueThe type of values in the dictionary.

Inheritance​

object→Dictionary<TKey, TValue>→SerializableDictionary<TKey, TValue>

Properties​

this[TKey]​

Gets the value associated with the specified key, or logs an error in the editor if the key is missing or duplicated.

public TValue this[TKey key] { get; }

Property Value​

TValue