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.
|
DurationFrames
The animation duration (in frames).
Declaration
[Unmanaged]
public int DurationFrames { get; }
Property Value
System.
|
FramesPerSecond
The frames amount per second of the timeline animation.
Declaration
[Unmanaged]
public float FramesPerSecond { get; }
Property Value
System.
|
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
Particle The emitter to playback. |
System. The timeline animation duration in seconds. |
System. The amount of frames per second of the timeline animation. |
LoadTimeline()
Loads the serialized timeline data.
Declaration
[Unmanaged]
public byte[] LoadTimeline()
Returns
System. 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. The timeline data container. |
Returns
System.
|
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. If set to |
Returns
Particle 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. If set to |
Returns
Particle 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. If set to |
Returns
Particle 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. If set to |
Returns
Particle 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. If set to |
Returns
Particle 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. If set to |
Returns
Particle The spawned effect. |