Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


Add

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

Definition

  • Type: Method
  • Namespace: Unity.Collections
  • Assembly: UnityEngine.ManagedKernelModule

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 a key-value pair with this key is already present, an additional separate key-value pair is added.

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 a key-value pair with this key is already present, an additional separate key-value pair is added.