If I set a shader for a material in the inspector to say, diffuse, then:
myMaterial.shader.name returns “Normal-Diffuse”,
and Shader.Find(“Normal-Diffuse”) returns null.
Similary for Diffuse (fast)
myMaterial.shader.name returns “Normal-DiffuseFast”,
and Shader.Find(“Normal-DiffuseFast”) returns null.
Shader.Find(" Diffuse")
Shader.Find(" Diffuse (fast)")
both work correctly though.
Why is this? And are there any reliable ways to convert a shader.name for use in Shader.Find statement?