How to AddComponent <Camera Effects"PRO" with Shader(s)>

Hello Forums,

I am having trouble scripting the AddComponent of Camera Effects with shaders such as Sepia and Grayscale to the Main Camera. It does add themselves to the camera but however it does not detect and shader it should come with whereas AddComponent itself should take care of knowing what belongs to the component and find it.

I am having no trouble AddComponent for effects such as Blur which does not have a shader. Maybe anyone could help me on this. Thanks in advance! =)

Research Dolphin.

Hi,

I had the same problem just a few minutes ago, and now I managed to do a workaround for this:

Texture myTex;
void Start()
{
	myTex = Resources.Load("ShaderTexture", typeof(Texture)) as Texture; 
}
void AddShader()
{
	Frost fo = _mainCam.AddComponent<Frost>();
	fo.shader = Shader.Find("Hidden/Frost");
	fo.noiseMap = myTex;
	
	// Set() it's a function I added there (Frost.cs) that just
	//calls the Awake() again (to set the texture etc)
	fo.Set(); 
	fo.active = true;
}