Reputation: 294
Does anyone know how to access and change the Renderer Data of Camera via script?
My purpose is this:
public bool ActiveDepth;
public Camera myCamera;
public RendererData renderClassic;
public RendererData renderDepth;
// if active get depth profile, else return to standard
void onGui()
{
if(!ActiveDepth)
myCamera.GetComponent<Renderer>().RendererData = renderClassic;
else
myCamera.GetComponent<Renderer>().RendererData = renderDepth;
}
Thanks
Upvotes: 1
Views: 966