Choice of rendering mode particles

Hi everybody

i have a little question.

Can I change stretch particles mode in ParticlesRenderer with a simple gui button in my application?

thanks

I guess you use more than one particle renderer that should be updated with this information. It sounds like you're having a global game setting. You could use a script that continuously set particleRenderMode based on a static variable that is accessible from the gui. This script could then be applied to each particle renderer object to set its mode to the static value. This would allow global-scale settings on select objects. Simply disable or remove the script from particle emitters that want to override this setting.


Here's an example to make particles use billboard rendering per your comment.

// C#
void MakeParticlesBillboard()
{
    var pr = GetComponent<ParticleRenderer>();
    pr.particleRenderMode = ParticleRenderMode.Billboard;
}

// JS
function MakeParticlesBillboard()
{
    var pr = (ParticleRenderer)GetComponent("ParticleRenderer");
    pr.particleRenderMode = ParticleRenderMode.Billboard;
}

Yes, if you script it using ParticleRenderer.particleRenderMode.