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

BatchRendererGroup.SetBatchBuffer

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

Declaration

public void SetBatchBuffer(BatchID batchID, GraphicsBufferHandle buffer);

Parameters

Parameter Description
batchID Unity changes the batch with this ID.
buffer The GraphicsBufferHandle of the GraphicsBuffer to be associated with the batch.

Description

Change the GraphicsBuffer associated with the given batch.

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.