Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


NativeKeyValueArrays<TKey, TValue>

The keys and values of a hash map copied into two parallel arrays.
Read time 1 minuteLast updated 13 days ago

Definition

public struct NativeKeyValueArrays<TKey, TValue> : INativeDisposable, IDisposable where TKey : unmanaged where TValue : unmanaged

Remarks

For each key-value pair copied from the hash map, the key is stored in
Keys[i]
while the value is stored in
Values[i]
(for the same
i
).
NativeKeyValueArrays is not actually itself a native collection: it contains a NativeArray for the keys and a NativeArray for the values, but a NativeKeyValueArrays does not have its own safety handles.

Fields

Value

Description

KeysThe keys.
ValuesThe values.

Constructors

Properties

Property

Description

LengthThe number of key-value pairs.

Methods

Method

Description

DisposeReleases all resources (memory and safety handles).