Skip to main content

Struct SerializableKeyValuePair<K, V>

A serializable key-value pair structure compatible with Unity's serialization system.

[Serializable]
public struct SerializableKeyValuePair<K, V>

Type Parameters​

NameTypeDescription
KThe type of the key.
VThe type of the value.

Constructors​

SerializableKeyValuePair(K, V)​

Constructs a new SerializableKeyValuePair with the specified key and value.

public SerializableKeyValuePair(K key, V value)

Parameters​

NameTypeDescription
keyKThe key to assign.
valueVThe value to assign.

Fields​

Key​

The key of the key-value pair.

public K Key

Field Value​

K

Value​

The value associated with the key.

public V Value

Field Value​

V

Operators​

implicit operator SerializableKeyValuePair<K, V>(KeyValuePair<K, V>)​

Implicit conversion from a standard KeyValuePair to a SerializableKeyValuePair.

public static implicit operator SerializableKeyValuePair<K, V>(KeyValuePair<K, V> kvp)

Parameters​

NameTypeDescription
kvpKeyValuePair<K, V>The key-value pair to convert.

Returns​

SerializableKeyValuePair<K, V>

implicit operator KeyValuePair<K, V>(SerializableKeyValuePair<K, V>)​

Implicit conversion from a SerializableKeyValuePair to a standard KeyValuePair.

public static implicit operator KeyValuePair<K, V>(SerializableKeyValuePair<K, V> kvp)

Parameters​

NameTypeDescription
kvpSerializableKeyValuePair<K, V>The serializable key-value pair to convert.

Returns​

KeyValuePair<K, V>

  • Constructors
    • SerializableKeyValuePair(K, V)
  • Fields
    • Key
    • Value
  • Operators
    • implicit operator SerializableKeyValuePair<K, V>(KeyValuePair<K, V>)
    • implicit operator KeyValuePair<K, V>(SerializableKeyValuePair<K, V>)