Accessing material of particle renderer??


I'm using Unity Indie 2.6.1 and have following code:

function Start () {
    var c = Color(Random.value,Random.value,Random.value,1);
    renderer.material.color = c;

If I've understood the documentation correctly this should also work with a particle renderer but I have no reaction at all. It works without any problems with a mesh renderer.

Does anybody have a suggestion what could be the problem?

Thank You!

The problem is that most particle shaders do not use "_Color" for their main color property.

(material.color is just a shortcut for material.SetColor("_Color", ...))

Most particle shaders right now use "_TintColor" as their color property. So you should do:

renderer.material.SetColor ("_TintColor", c));