Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

SetSharedComponent garbage collection

Discussion in 'Entity Component System' started by tommox86, Apr 29, 2021.

  1. tommox86

    tommox86

    Joined:
    Apr 30, 2015
    Posts:
    81
    I need to modifiy a mesh(animating the material every frame) however calling setsharedcomponent via ecb is causing alot of garbage collection.. Is there another way to access and set the data for RenderMesh or update the material without calling setsharedcomponent ?
     
    Last edited: Apr 29, 2021
  2. tommox86

    tommox86

    Joined:
    Apr 30, 2015
    Posts:
    81
    i managed to solve this by using materialpropertyblock then drawing the mesh using graphics.drawmesh
    now getting zero garbage.