Find a shader not in the scene

Hi there,

I was wondering if someone could direct me as to go about finding the inbuilt shaders within my script without having them attached to a material in my scene. I keep getting null pointer exceptions when i start my scene. Here is part of my code:

	private var render:Renderer;
private var shaders:Shader[];

function Start () {
	render = this.gameObject.renderer;
	shaders[0] = Shader.Find("Transparent/Bumped Diffuse");
	shaders[1] = Shader.Find("Transparent/Bumped Specular");
	shaders[2] = Shader.Find("Transparent/VertexLit");
	shaders[3] = Shader.Find("HeatDistort");
	shaders[4] = Shader.Find("FX/Flare");
	shaders[5] = Shader.Find("Particles/Additive");
	shaders[6] = Shader.Find("Particles/Soft");
	shaders[7] = Shader.Find("Particles/Multiply");
	shaders[8] = Shader.Find("Particles/Multiply (Double)");

Thanks in advance

  • facepalm* forgot to initialise array :confused:

       shaders = new Shaders[9];