- Home /
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
Answer by Statement · Dec 23, 2010 at 08:29 PM
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; }
sorry but i don't understand! I have one particle emiter but i don't say how to apply the new stretch for this emiter! particleRender$$anonymous$$ode.billboard for example isn't applied directly by a variable, isn't it ? sorry for my english, i am french. thank u
I updated my answer with an example on how that variable is set.
Answer by HolBol · Dec 23, 2010 at 05:27 PM
Yes, if you script it using ParticleRenderer.particleRenderMode.
Your answer
![](https://koobas.hobune.stream/wayback/20220613092248im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Very Bad Lag from ~20 Large Particles 0 Answers
Making a GetComponent array 1 Answer
Fire effect with minimal overdraw 1 Answer
help with iphone 3GS performance (polys and audio) 2 Answers
Large level loading best practices 1 Answer