TryAdd
Adds a new value. If the item is already present, this method returns false without replacing said item.
読み終わるまでの所要時間 1 分最終更新 1ヶ月前
Definition
- Type: Method
- Namespace: Unity.Collections.LowLevel.Unsafe
- Assembly: UnityEngine.ManagedKernelModule
TryAdd(T)
Adds a new value. If the item is already present, this method returns false without replacing said item.
public bool TryAdd(T item)
Parameters
Returns
Type | Description |
|---|---|
| bool | True if the value is not already present. |
TryAdd(T, int)
Adds a new value. If the item is already present, this method returns false without replacing said item.
public bool TryAdd(T item, int threadIndexOverride)
Parameters
The thread index which must be set by a field from a job struct with the NativeSetThreadIndexAttribute attribute.
Returns
Type | Description |
|---|---|
| bool | True if the value is not already present. |