Version: Unity 7.0 Alpha (7000.0)
LanguageEnglish
  • C#

BufferTypeHandle<T0>

struct in Unity.Entities

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

A handle to a specific buffer component type, used to access an ArchetypeChunk's component data in a job.

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 BufferTypeHandle, use ComponentSystemBase.GetBufferTypeHandle. 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 BufferTypeHandle<T0>.Update just before use.

If the component type is not known at compile time, use DynamicComponentTypeHandle.

Properties

Property Description
GlobalSystemVersionThe global system version for which this handle is valid.
IsReadOnly Reports whether this type handle was created in read-only mode.

Public Methods

Method Description
ToFixedString Returns the formatted FixedString "BufferTypeHandle[type_name_here]".
Update When a BufferTypeHandle 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.