I’m switching shaders to highlight objects and am having trouble with re-applying the standard shader. It seems simple enough and works in some cases but not all which is confusing me.
Here are my shader references:
_standardShader = Shader.Find("Standard");
_highlightShader = Shader.Find("Oculus/UnlitTransparent");
And here is the code that calls it on a gameobject:
void SetTileSelected(GameObject tile)
{
Debug.LogFormat("Setting shader selected: {0}", tile.name);
_renderer.material.shader = _highlightShader;
}
void SetTileUnSelected(GameObject tile)
{
Debug.LogFormat("Setting shader un-selected: {0}", tile.name);
_renderer.material.shader = _standardShader;
}
Is there any reason why the shader would not be applied immediately or maybe I need an update of some sort to force the shader to apply?
Thanks in advance for any insights!