I have created lines using this,
LineRenderer line = new GameObject ("Line " + i.ToString ()).AddComponent<LineRenderer>();
line.SetColors (transRed, transRed);
Material lineGreen = new Material(Shader.Find("Particles/Alpha Blended"));
line.material = lineGreen;
and a sphere like this,
GameObject mySphere = GameObject.CreatePrimitive(PrimitiveType.Sphere) as GameObject;
Material myMaterial = new Material(Shader.Find("Particles/Alpha Blended"));
myMaterial.color = transRed;
mySphere.GetComponent<MeshRenderer> ().material = myMaterial;
The colour transRed is,
transRed.a = 0.4f;
transRed.r = 1.1f;
transRed.g = 0.496078431f;
transRed.b = 0.0f;
My problem is that the line and sphere aren't coming in same colour. The line is of the colour I want, but the sphere is white. I'm using same shader and same colour variable. Any help?