SpawnerFromParent Class
Namespace: Stride.Particles.SpawnersAssembly: Stride.Particles.dll
A particle spawner which continuously spawns particles based on a condition set in a followed (parent) emitter
[DataContract("SpawnerFromParent")]
[Display("From parent", null)]
public sealed class SpawnerFromParent : ParticleSpawner
Name | Description | |
---|---|---|
Constructors | ||
SpawnerFromParent() | Default constructor |
|
Fields | ||
Parent | Referenced parent emitter |
|
Properties | ||
ParentControlFlag | Some initializers require fine control between parent and child emitters. Use the control group to assign such meta-fields. |
|
ParentName | Name by which to reference a followed (parent) emitter |
|
ParticleSpawnTrigger | ParticleSpawnTrigger provides a class which checks if the spawning condition has triggered |
|
SpawnCount | The amount of particles this spawner will emit when the event is triggered |
|
Methods | ||
GetMaxParticlesPerSecond() | Get the maximum number of particles this spawner can emit in one second |
|
GetSpawnControlField() | Gets a field accessor to the parent emitter's spawn control field, if it exists |
|
InvalidateRelations() | Invalidates relation of this emitter to any other emitters that might be referenced |
|
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
SpawnerFromParent()
Default constructor
public SpawnerFromParent()
Fields
Parent
Referenced parent emitter
protected ParticleEmitter Parent
Field Value
Type | Description |
---|---|
ParticleEmitter |
Properties
ParentControlFlag
Some initializers require fine control between parent and child emitters. Use the control group to assign such meta-fields.
[DataMember(40)]
[Display("Spawn Control Group", null)]
public ParentControlFlag ParentControlFlag { get; set; }
Property Value
Type | Description |
---|---|
ParentControlFlag |
ParentName
Name by which to reference a followed (parent) emitter
[DataMember(30)]
[Display("Parent emitter", null)]
public string ParentName { get; set; }
Property Value
Type | Description |
---|---|
System.String |
ParticleSpawnTrigger
ParticleSpawnTrigger provides a class which checks if the spawning condition has triggered
[DataMember(45)]
public ParticleSpawnTrigger ParticleSpawnTrigger { get; set; }
Property Value
Type | Description |
---|---|
ParticleSpawnTrigger |
SpawnCount
The amount of particles this spawner will emit when the event is triggered
[DataMember(50)]
[Display("Particles/trigger", null)]
public Vector2 SpawnCount { get; set; }
Property Value
Type | Description |
---|---|
Vector2 |
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
GetSpawnControlField()
Gets a field accessor to the parent emitter's spawn control field, if it exists
protected ParticleFieldAccessor<ParticleChildrenAttribute> GetSpawnControlField()
Returns
Type | Description |
---|---|
ParticleFieldAccessor<ParticleChildrenAttribute> |
InvalidateRelations()
Invalidates relation of this emitter to any other emitters that might be referenced
public override void InvalidateRelations()
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 |