Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


Add

Adds a new key-value pair.
Read time 1 minuteLast updated 14 days ago

Definition

Add(T, T)

Adds a new key-value pair.
public void Add(TKey key, TValue item)

Parameters

key

T
The key to add.

item

T
The value to add.

Remarks

If the key is already present, this method throws without modifying the hash map.

Add(T, T, int)

Adds a new key-value pair.
public void Add(TKey key, TValue item, int threadIndexOverride)

Parameters

key

T
The key to add.

item

T
The value to add.

threadIndexOverride

The thread index which must be set by a field from a job struct with the NativeSetThreadIndexAttribute attribute.

Remarks

If the key is already present, this method throws without modifying the hash map.