DynamicSharedComponentTypeHandle
A handle to a specific shared component type, used to access an ArchetypeChunk 's component data in a job.
Read time 1 minuteLast updated a day ago
Definition
- Type: Struct
- Namespace: Unity.Entities
- Assembly: UnityEngine.EntitiesModule
public struct DynamicSharedComponentTypeHandle
Remarks
Passing a type handle to a job automatically registers the job as a reader or writer of that type, which allows the DOTS safety system to detect potential race conditions between concurrent jobs which access the same component type.
To create a DynamicSharedComponentTypeHandle, use ComponentSystemBase.GetDynamicSharedComponentTypeHandle. While type handles can be created just in time before they're used, it is more efficient to create them once during system creation, cache them in a private field on the system, and incrementally update them with DynamicSharedComponentTypeHandle.Update just before use.
If the component type is known at compile time, use SharedComponentTypeHandle<T>.
Methods
Method | Description |
|---|---|
| ToFixedString | Returns the formatted FixedString "DynamicSharedComponentTypeHandle[type_name_here]". |
| Update | When a DynamicSharedComponentTypeHandle is cached by a system across multiple system updates, calling this function inside the system's OnUpdate() method performs the minimal incremental updates necessary to make the type handle safe to use. |