Set the visibility of the elements in mesh renderer

i have two elements in the materials of mesh renderer
element0: unlocked
element1: locked

Now what i want to do is

          `void start()
          {
          if(something==true)
          element[0] becomes visible or show up and element[1] becomes invisible
          else
          element[1] becomes visible and element[0] becomes invisible
          }`

I’m not sure what kinds of elements you are talking about, but the most basic way of controlling what gets rendered and what not is just to switch an object’s layer to one that is not rendered by the camera (check the camera’s culling mask). the inversion would be to change the layers in the camera’s culling mask.