设置粒子生命周期。


描述

This action will set the lifespan of the given particle type. You first specify the particle type ID value (which is the value returned when you created the particle using the Create Particle Type action) and then you can set the minimum and maximum lifespan of the particle in game frames. For example, if your game has a frames per second of 60, then setting both the lifespan values here to 60 will mean that the particles will last 1 second on screen before disappearing. If you use two different values then each particle spawned will have a random lifespan set within the given minimum and maximum. Note that all values should be positive integers.

IMPORTANT! Setting very long lifespans and then emitting hundreds of particles, can cause issues on less powerful machines and on mobile devices. Take care when setting particle lifespan to maximise the visual effect but minimise the performance cost, and only use very long lifespan particles sparingly.


动作语法:

Set Particle Life Syntax


参数:

参数 描述
Type ID The ID value for the global type to set the lifespan of
最小生命周期 The minimum lifespan for a particle (in game frames)
最大生命周期 The maximum lifespan for a particle (in game frames)


例如:

Set Particle Life Example
The above action block code will create a new particle type and assign its unique ID value to a global variable. It then proceeds to set all the properties for the particle type.