Class ParticlesComponent
Class representing a particle system component.
Inheritance
Implements
Inherited Members
Namespace: Evergine.Framework.Particles.Components
Assembly: Evergine.Framework.dll
Syntax
public class ParticlesComponent : Component, IDependencyObject
Constructors
ParticlesComponent()
Initializes a new instance of the ParticlesComponent class.
Declaration
public ParticlesComponent()
Fields
EmitAutomatically
If true, the particle system will automatically start emitting particles.
Declaration
public bool EmitAutomatically
Field Value
Type | Description |
---|---|
bool |
LifeFactor
Gets or sets the lifespan factor.
Declaration
public float LifeFactor
Field Value
Type | Description |
---|---|
float |
TimeFactor
Gets or sets the time factor.
Declaration
public float TimeFactor
Field Value
Type | Description |
---|---|
float |
Transform
The transformation of the particle system.
Declaration
[BindComponent(true, true, BindComponentSource.Owner, null, true)]
public Transform3D Transform
Field Value
Type | Description |
---|---|
Transform3D |
Properties
Emitters
Gets the particle system emitters.
Declaration
public IEnumerable<EmitterSimulator> Emitters { get; }
Property Value
Type | Description |
---|---|
IEnumerable<EmitterSimulator> |
ForceCPUParticles
Gets or sets a value indicating whether to force the simulation of the particle system using the CPU instead of the compute shader.
Declaration
public bool ForceCPUParticles { get; set; }
Property Value
Type | Description |
---|---|
bool |
IsEmitting
Gets a value indicating whether the particle system is emitting.
Declaration
public bool IsEmitting { get; }
Property Value
Type | Description |
---|---|
bool |
IsSimulating
Gets a value indicating whether the particle system is emitting particles this frame or has any alive particles.
Declaration
public bool IsSimulating { get; }
Property Value
Type | Description |
---|---|
bool |
ParticleSystem
Gets or sets the particle system asset of the component.
Declaration
public ParticleSystem ParticleSystem { get; set; }
Property Value
Type | Description |
---|---|
ParticleSystem |
SourceEntity
Gets or sets the target entity.
Declaration
public Entity SourceEntity { get; set; }
Property Value
Type | Description |
---|---|
Entity |
SourceEntityId
Gets or sets the ID of the target entity.
Declaration
public Guid SourceEntityId { get; set; }
Property Value
Type | Description |
---|---|
Guid |
SourceEntityPath
Gets or sets the path of the target entity.
Declaration
public string SourceEntityPath { get; set; }
Property Value
Type | Description |
---|---|
string |
Methods
OnAttached()
Invoked when the object is attached to the system.
Declaration
protected override bool OnAttached()
Returns
Type | Description |
---|---|
bool | True if everything is OK. |
Overrides
OnDestroy()
Invoked when the object is about to be disposed.
Declaration
protected override void OnDestroy()
Overrides
OnDetach()
Invoked when the object is detached.
Declaration
protected override void OnDetach()
Overrides
RefreshParticleSystem()
Refreshes the particle system properties.
Declaration
public void RefreshParticleSystem()
Reset()
Resets the state of the particle system.
Declaration
public void Reset()
Start()
Invoked to start the object.
Declaration
protected override void Start()
Overrides
StartEmitting()
Starts the particle emission.
Declaration
public void StartEmitting()
StopEmitting()
Stops the particle emission.
Declaration
public void StopEmitting()
Events
ParticleSystemUpdated
Event triggered when the particle system asset is updated.
Declaration
public event EventHandler<ParticleSystem> ParticleSystemUpdated
Event Type
Type | Description |
---|---|
EventHandler<ParticleSystem> |
SourceEntityChanged
Event fired when a new entity is selected as the target of a particle system.
Declaration
public event EventHandler<Entity> SourceEntityChanged
Event Type
Type | Description |
---|---|
EventHandler<Entity> |