- Home /
Acces the secondary colors in the shaders.
Hi, I am trying to make an object that changes color over time. However I only seem to be able to access the materials main color. I can't acces the specular color. Or in the case I am working on, I am trying to access the tint color in the Particle/Addative shader. Does anybody know how you can access these?
The code I am using now is javascrip.
if (LI.intensity > 1){ LI.intensity = LI.intensity - 0.6; renderer.material.color = renderer.material.color - Vector4(0,0,0,0.1); print(renderer.material.color); }
Answer by Jessy · Jan 07, 2011 at 03:01 PM
http://unity3d.com/support/documentation/ScriptReference/Material.SetColor.html
http://unity3d.com/support/documentation/ScriptReference/Material.GetColor.html
Get the source code for the shader in the sticky at the top of the ShaderLab forum.
renderer.material.SetColor("_TintColor", Color.cyan);