Particle effects
1: There will be cool special effects in the game, such as explosions, splashes, flames, etc.
2:unity provides particle editor to facilitate special effects personnel to develop cool special effects;
3. Particle effects generally have a special particle effect division to do, we just need to use the good, many parameters do not need to master.
Particle System Component Panel
1: particle system body;
2: Squirt (emission);
3: Shape (shape);
4: Velocity shift over the life cycle (velocity over lifetime);
5: Limiting speed over the life cycle (limit velocity over lifetime);
6: Force shift over the life cycle (forces velocity over lifetime);
7: Color in the life cycle (color velocity over lifetime);
8: Color changes with speed (color by velocity);
9: The size of the life cycle (size over lifetime);
10: Size varies with velocity (size by speed);
11: Rotational speed during the life cycle (Rotation over lifetime);
12: Angular velocity varies with velocity (Rotation by speed);
13: External force (External forces)
14: Collision (collision)
15: Sub-transmitting system (sub eimitters);
16: Texture layer Animation (Texture Sheet Animation);
17: Renderer (render);
Node Property Board
1:duration: particle ejection cycle;
2:looping: whether the circulating injection;
3:prewarm: preheating (pre-generating the next cycle of particles in the loop state);
4:startdelay: Particle jet delay, prewarm cannot be delayed;
5:start Lifetime: particle life cycle;
6:start speed: particle jet velocity;
7:start Rotation: particle size;
8:start color: particle colour;
9:gravity Modifier: Gravity density (scaling ratio) relative to gravity acceleration;
10:inherit Velocity: The rate of succession of newborn particles;
11:simulation Space: Simulation spaces for particle systems;
12:play on awake: whether to play when loading;
13:maxparticles: Number of instances fired within a week, with this number stopping the launch
Shape Properties Board
1: Decided the example of the range of the system jets;
2: The main shapes are:
Sphere (Sphere) hemisphere (hemisphere)
Cone Cone, boxes (box)
Mesh (mesh) ring (cricle) Edge (Edge)
Renderer Property Board
Create steps
1: Create a Unity Project
2: Create a particle
(1) gameobject--> particle System;
(2) Create a node--add a particlesystem component;
Import and use
1: Create a Unity Project
2.import Package---->cuostom Package---->partycle.unitypackage
3. Drag the preform tree into the node view
4. Create a script to mount the test_particle to the tree node, control particle properties and manipulate it through code
The contents of the 5.test_particle script are as follows:
usingUnityengine;usingSystem.Collections; Public classTest_particle:monobehaviour {Particlesystem ps; //Use this for initialization voidStart () { This. PS = This. Getcomponent<particlesystem>(); Debug.Log ( This. ps.duration); This. Invoke ("play_particle",5); } voidplay_particle () { This. PS. Play (); } //Update is called once per frame voidUpdate () {if(Input.getkeydown (keycode.space)) {if( This. ps.ispaused) { This. PS. Play (); } Else { This. PS. Pause (); } } if(Input.getkeydown (KEYCODE.S)) {if( This. ps.isstopped) { This. PS. Play (); } Else { This. PS. Stop (); } } }}
About the use of particle effects in unity