Class ParticleSystem
Particle system contains a composition of particle emitters and playback information.
Namespace: FlaxEngine
Assembly: FlaxEngine.CSharp.dll
Syntax
[Unmanaged]
public class ParticleSystem : BinaryAsset
Constructors
ParticleSystem()
Properties
Duration
The animation duration (in seconds).
Declaration
[Unmanaged]
public float Duration { get; }
Property Value
System.Single
|
DurationFrames
The animation duration (in frames).
Declaration
[Unmanaged]
public int DurationFrames { get; }
Property Value
System.Int32
|
FramesPerSecond
The frames amount per second of the timeline animation.
Declaration
[Unmanaged]
public float FramesPerSecond { get; }
Property Value
System.Single
|
Methods
Init(ParticleEmitter, Single, Single)
Initializes the particle system that plays a single particles emitter. This can be used only for virtual assets.
Declaration
[Unmanaged]
public void Init(ParticleEmitter emitter, float duration, float fps = 60F)
Parameters
ParticleEmitter
emitter
The emitter to playback. |
System.Single
duration
The timeline animation duration in seconds. |
System.Single
fps
The amount of frames per second of the timeline animation. |
LoadTimeline()
Loads the serialized timeline data.
Declaration
[Unmanaged]
public byte[] LoadTimeline()
Returns
System.Byte[]
The output surface data, or empty if failed to load. |
SaveTimeline(Byte[])
Saves the serialized timeline data to the asset.
Declaration
[Unmanaged]
public bool SaveTimeline(byte[] data)
Parameters
System.Byte[]
data
The timeline data container. |
Returns
System.Boolean
|
Spawn(Actor, Transform, Boolean)
Spawns the particles at the given location.
Declaration
[Unmanaged]
public ParticleEffect Spawn(Actor parent, Transform transform, bool autoDestroy = false)
Parameters
Actor
parent
The parent actor (can be null to link it to the first loaded scene). |
Transform
transform
The spawn transform. |
System.Boolean
autoDestroy
If set to |
Returns
ParticleEffect
The spawned effect. |
Spawn(Actor, Vector3, Quaternion, Boolean)
Spawns the particles at the given location.
Declaration
[Unmanaged]
public ParticleEffect Spawn(Actor parent, Vector3 position, Quaternion rotation, bool autoDestroy = false)
Parameters
Actor
parent
The parent actor (can be null to link it to the first loaded scene). |
Vector3
position
The spawn position. |
Quaternion
rotation
The spawn rotation. |
System.Boolean
autoDestroy
If set to |
Returns
ParticleEffect
The spawned effect. |
Spawn(Actor, Vector3, Boolean)
Spawns the particles at the given location.
Declaration
[Unmanaged]
public ParticleEffect Spawn(Actor parent, Vector3 position, bool autoDestroy = false)
Parameters
Actor
parent
The parent actor (can be null to link it to the first loaded scene). |
Vector3
position
The spawn position. |
System.Boolean
autoDestroy
If set to |
Returns
ParticleEffect
The spawned effect. |
Spawn(Transform, Boolean)
Spawns the particles at the given location.
Declaration
[Unmanaged]
public ParticleEffect Spawn(Transform transform, bool autoDestroy = false)
Parameters
Transform
transform
The spawn transform. |
System.Boolean
autoDestroy
If set to |
Returns
ParticleEffect
The spawned effect. |
Spawn(Vector3, Quaternion, Boolean)
Spawns the particles at the given location.
Declaration
[Unmanaged]
public ParticleEffect Spawn(Vector3 position, Quaternion rotation, bool autoDestroy = false)
Parameters
Vector3
position
The spawn position. |
Quaternion
rotation
The spawn rotation. |
System.Boolean
autoDestroy
If set to |
Returns
ParticleEffect
The spawned effect. |
Spawn(Vector3, Boolean)
Spawns the particles at the given location.
Declaration
[Unmanaged]
public ParticleEffect Spawn(Vector3 position, bool autoDestroy = false)
Parameters
Vector3
position
The spawn position. |
System.Boolean
autoDestroy
If set to |
Returns
ParticleEffect
The spawned effect. |