Beispiel #1
0
    private void createCommandBuffer(ref CmdBuffer aCmdBuffer, string aCmdBufferName, CameraEvent aCameraEvent)
    {
        if (aCmdBuffer.cmdBuffer != null)
        {
            cleanupCommandBuffer(ref aCmdBuffer);
        }

        aCmdBuffer.cmdBufferName = aCmdBufferName;

        aCmdBuffer.cmdBuffer      = new CommandBuffer();
        aCmdBuffer.cmdBuffer.name = aCmdBufferName;

        aCmdBuffer.cmdBufferEvent = aCameraEvent;

        m_targetCamera.AddCommandBuffer(aCameraEvent, aCmdBuffer.cmdBuffer);
    }
Beispiel #2
0
    private void cleanupCommandBuffer(ref CmdBuffer aCmdBuffer)
    {
        CommandBuffer[] currentCBs = m_targetCamera.GetCommandBuffers(aCmdBuffer.cmdBufferEvent);

        for (int i = 0; i < currentCBs.Length; i++)
        {
            if (currentCBs[i].name == aCmdBuffer.cmdBufferName)
            {
                m_targetCamera.RemoveCommandBuffer(aCmdBuffer.cmdBufferEvent, currentCBs[i]);
            }
        }

        aCmdBuffer.cmdBufferName  = null;
        aCmdBuffer.cmdBufferEvent = 0;
        aCmdBuffer.cmdBuffer      = null;
    }
 public SocketCommandTag()
 {
     Buffer = new CmdBuffer();
 }