SpawnerPerFrame Class
Namespace: Stride.Particles.SpawnersAssembly: Stride.Particles.dll
A particle spawner which continuously spawns particles. Number of particles to be spawned is given in seconds.
[DataContract("SpawnerPerFrame")]
[Display("Per frame", null)]
public sealed class SpawnerPerFrame : ParticleSpawner
Name | Description | |
---|---|---|
Constructors | ||
SpawnerPerFrame() | Default constructor |
|
Properties | ||
Framerate | The maximum framerate you expect your game to achieve. It is only used for maximum particles estimation, not for actual spawning rate |
|
SpawnCount | The amount of particles this spawner will emit each frame |
|
Methods | ||
GetMaxParticlesPerSecond() | Get the maximum number of particles this spawner can emit in one second |
|
SpawnNew(Single, ParticleEmitter) | This method will be called form the emitter when it needs to poll how many particles to spawn (usually once per frame) |
Constructors
SpawnerPerFrame()
Default constructor
public SpawnerPerFrame()
Properties
Framerate
The maximum framerate you expect your game to achieve. It is only used for maximum particles estimation, not for actual spawning rate
[DataMember(45)]
[Display("Framerate", null)]
public float Framerate { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
SpawnCount
The amount of particles this spawner will emit each frame
[DataMember(40)]
[Display("Particles/frame", null)]
public float SpawnCount { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
Methods
GetMaxParticlesPerSecond()
Get the maximum number of particles this spawner can emit in one second
public override int GetMaxParticlesPerSecond()
Returns
Type | Description |
---|---|
System.Int32 | Peak particles per second |
Overrides
SpawnNew(Single, ParticleEmitter)
This method will be called form the emitter when it needs to poll how many particles to spawn (usually once per frame)
public override void SpawnNew(float dt, ParticleEmitter emitter)
Parameters
Type | Name | Description |
---|---|---|
System.Single | dt | Time it has past since the last update (in seconds) |
ParticleEmitter | emitter | Parent emitter in which new particles should be emitter |