Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - How to change parameters with code in the new Unity latest particle system?
How to change parameters with code in the new Unity latest particle system?
Which part of the particle do you want to modify with code?

Here is a reference address for you:/scriptreference/particlesystem.html.

In the reference address, you can find the parameters in each module, which are explained and used in detail. In fact, it is very convenient to control the particle system with code, but first you have to understand all parts of the particle system.

For example, if you want to modify the duration in the main module, you can do this:

Public? Class? ExampleClass? :? Single behavior {

Private? ParticleSystem? PS;

Invalid? Start ()

{

ps? =? GetComponent & ltParticleSystem & gt();

ps。 stop(); ? //? Can't? Settings? Duration? At the same time Particles? System? Is it? Performance, style, etc of playing; Play (music)

var? Mainly? =? ps.main

Duration? =? 10.0 f;

ps。 play();

}

} Here you can open the reference address of the MainModule, so that you have the parameters you need, similar to other modules.

Please add any questions.