Hi,
My Sprite Collection uses a material with the 2dTk "BlendVertexColor" shader. I'm creating sprites from that collection at runtime like this:
tk2dSpriteCollectionData spriteCollection = Resources.Load("HexTilesData", typeof(tk2dSpriteCollectionData)) as tk2dSpriteCollectionData;
tk2dSprite tileSprite = tk2dSprite.AddComponent(goTemp,spriteCollection, "hexBorder");
Now I'm trying to change the shader of one sprite at runtime to the 2dTk shader "AdditiveVertexColor" like this:
selectedHexTile.sprite.renderer.material.shader = Shader.Find("AdditiveVertexColor");
But it doesn't work. The Sprite will be rendered in solid pink
. I guess that's because Unity can't find the "AdditiveVertexColor" shader. I tried to put the shader in a Resources folder but that didn't worked either.
What is the right way to change the shader?