Documentation

Unity Engine

Download Unity

Unity Engine

AddBuffer<T>()

Adds a Buffer of T elements, an IBufferElementData, to this GameObject.
Read time 1 minuteLast updated 6 hours ago

Definition

public DynamicBuffer<T> AddBuffer<T>() where T : unmanaged, IBufferElementData

Returns

Type

Description

DynamicBuffer<T>The Buffer. If the GameObject already had the Buffer, the existing Buffer.

Remarks

Throws an
ArgumentException
if the GameObject has been destroyed.
This is a structural change: it waits for all jobs in the World to complete. To make it from a job or a system without waiting, record it in a
Unity.Entities.EntityCommandBuffer
instead.