void Reset()

robot_2Generated
code_blocksInput

Description

The Reset method of the CommandList class is used to clear all the commands that have been recorded in the command list. This method prepares the command list for reuse, allowing you to start recording new commands from scratch. It is essential to call this method before reusing a command list to ensure that previous commands do not interfere with new ones.

Usage

To use the Reset method, simply call it on an instance of CommandList when you need to clear the current list of commands and prepare it for new command recording. This is typically done at the beginning of a new frame or rendering pass.

Example

// Example of using the Reset method
CommandList commandList = new CommandList();

// Record some commands
commandList.Blit(material);
commandList.DrawQuad(rect, material, color);

// Reset the command list to clear previous commands
commandList.Reset();

// Now you can record new commands
commandList.DrawModel(model, transform, attributes);