Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


SetBatchBuffer(BatchID, GraphicsBufferHandle)

Change the GraphicsBuffer associated with the given batch.
Read time 1 minuteLast updated 3 days ago

Definition

public void SetBatchBuffer(BatchID batchID, GraphicsBufferHandle buffer)

Parameters

batchID

Unity changes the batch with this ID.

The
GraphicsBufferHandle
of the
GraphicsBuffer
to be associated with the batch.

Remarks

You can call this method at any time, but Unity doesn't apply the change immediately. Unity applies the change the next time it starts a culling pass, before it calls
OnPerformCulling
. Until then, draw commands that Unity has already generated still use the previous buffer.
Don't dispose of the previous
GraphicsBuffer
in the same frame that you call this method. Instead, dispose of it in the next frame, for example in the next
Update
call. If Unity renders draw commands that refer to a disposed buffer, the result is undefined.