Description
The InsertList
method is used to execute another CommandList
within the current CommandList
. This allows for the composition of multiple command lists, enabling more complex rendering operations by combining different sets of rendering commands.
Usage
To use the InsertList
method, you need to have an instance of CommandList
that you want to insert into the current command list. This method is useful when you want to modularize your rendering commands and execute them in a specific order.
Example
// Create two CommandList instances
CommandList mainCommandList = new CommandList();
CommandList secondaryCommandList = new CommandList();
// Populate the secondary command list with rendering commands
secondaryCommandList.Blit(someMaterial);
secondaryCommandList.DrawQuad(someRect, someMaterial, someColor);
// Insert the secondary command list into the main command list
mainCommandList.InsertList(secondaryCommandList);
// Execute the main command list
mainCommandList.Execute();