Hi,
My game have the ability to change the shaders on the run but here goes the problem: When I build in for my mobile the shaders doesn’t seems to load at all.
I already put all the shaders I need in a resources folder with no success, I even tried to put some spheres with the shaders to force the import.
Strange things to note:
-If i build only a level the shaders work fine but if I build with the starting menu it doesn’t when I load the first level.
-When I print the name of the shader it is using it’s the good one (a toon shader) but the rendering looks like it’s a diffuse.
What could it be? Some of you guys already encoutered a similar issue?
Thanks.
Edit: I found that half of it is working actually. The instantiated materials don’t change while the others do.
foreach(GameObject npc in npcs)
{
npc.GetComponent<Human>().deadSkin.shader=Shader.Find("Toon/Basic Outline Alpha"); // this works
npc.GetComponentInChildren<SkinnedMeshRenderer>().sharedMaterial.shader=Shader.Find("Toon/Lighted Outline"); // this doesn't
npc.GetComponentInChildren<SkinnedMeshRenderer>().sharedMaterial.color=new Color(0.55f, 0.55f, 0.55f, 1f);
}
I tried with both material and sharedMaterial methods. Again this works if I built the level only but then with LevelLoad it does not.