Class ParticleEmitter
Binary asset that contains a particle emitter definition graph for running particles simulation on CPU and GPU.
Namespace: FlaxEngine
Assembly: FlaxEngine.CSharp.dll
Syntax
[Unmanaged]
public class ParticleEmitter : BinaryAsset
Constructors
ParticleEmitter()
Methods
LoadSurface(Boolean)
Tries to load surface graph from the asset.
Declaration
[Unmanaged]
public byte[] LoadSurface(bool createDefaultIfMissing)
Parameters
System.Boolean
createDefaultIfMissing
True if create default surface if missing. |
Returns
System.Byte[]
The output surface data, or empty if failed to load. |
SaveSurface(Byte[])
Updates surface (saves new one, discard cached data, reloads asset).
Declaration
[Unmanaged]
public bool SaveSurface(byte[] data)
Parameters
System.Byte[]
data
The surface graph data. |
Returns
System.Boolean
True if cannot save it, otherwise false. |
Spawn(Actor, Transform, Single, Boolean)
Spawns the particles at the given location.
Declaration
[Unmanaged]
public ParticleEffect Spawn(Actor parent, Transform transform, float duration = 3.40282347E+38F, 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.Single
duration
The effect playback duration (in seconds). |
System.Boolean
autoDestroy
If set to |
Returns
ParticleEffect
The spawned effect. |
Spawn(Actor, Vector3, Quaternion, Single, Boolean)
Spawns the particles at the given location.
Declaration
[Unmanaged]
public ParticleEffect Spawn(Actor parent, Vector3 position, Quaternion rotation, float duration = 3.40282347E+38F, 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.Single
duration
The effect playback duration (in seconds). |
System.Boolean
autoDestroy
If set to |
Returns
ParticleEffect
The spawned effect. |
Spawn(Actor, Vector3, Single, Boolean)
Spawns the particles at the given location.
Declaration
[Unmanaged]
public ParticleEffect Spawn(Actor parent, Vector3 position, float duration = 3.40282347E+38F, 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.Single
duration
The effect playback duration (in seconds). |
System.Boolean
autoDestroy
If set to |
Returns
ParticleEffect
The spawned effect. |
Spawn(Transform, Single, Boolean)
Spawns the particles at the given location.
Declaration
[Unmanaged]
public ParticleEffect Spawn(Transform transform, float duration = 3.40282347E+38F, bool autoDestroy = false)
Parameters
Transform
transform
The spawn transform. |
System.Single
duration
The effect playback duration (in seconds). |
System.Boolean
autoDestroy
If set to |
Returns
ParticleEffect
The spawned effect. |
Spawn(Vector3, Quaternion, Single, Boolean)
Spawns the particles at the given location.
Declaration
[Unmanaged]
public ParticleEffect Spawn(Vector3 position, Quaternion rotation, float duration = 3.40282347E+38F, bool autoDestroy = false)
Parameters
Vector3
position
The spawn position. |
Quaternion
rotation
The spawn rotation. |
System.Single
duration
The effect playback duration (in seconds). |
System.Boolean
autoDestroy
If set to |
Returns
ParticleEffect
The spawned effect. |
Spawn(Vector3, Single, Boolean)
Spawns the particles at the given location.
Declaration
[Unmanaged]
public ParticleEffect Spawn(Vector3 position, float duration = 3.40282347E+38F, bool autoDestroy = false)
Parameters
Vector3
position
The spawn position. |
System.Single
duration
The effect playback duration (in seconds). |
System.Boolean
autoDestroy
If set to |
Returns
ParticleEffect
The spawned effect. |