Sinespace Client  2023.2.17543
Client-side scripting for Sinespace
SineSpace.Scripting.Components.SParticleSystem Class Reference
Inheritance diagram for SineSpace.Scripting.Components.SParticleSystem:
ScriptClassComponent< ParticleSystem >

Public Member Functions

void Play (bool withChildren)
 Starts the Particle System. More...
 
void Stop (bool withChildren)
 Stops playing the Particle System using the supplied stop behavior. More...
 
void Pause (bool withChildren)
 Pauses the system so no new particles are emitted and the existing particles are not updated. More...
 
void Clear (bool withChildren)
 Remove all particles in the Particle System. More...
 
bool IsAlive (bool withChildren)
 Does the Particle System contain any live particles, or will it produce more? More...
 
void Clear ()
 
void Emit (int count)
 Emit count particles immediately. More...
 
void Stop ()
 
void Pause ()
 
void Play ()
 
void Simulate (float time)
 Fast-forwards the Particle System by simulating particles over the given period of time, then pauses it. More...
 
void SetTriggerParticles (SParticleSystemTriggerEventType type, SParticle[] sp)
 
SParticle[] GetTriggerParticles (SParticleSystemTriggerEventType type)
 

Properties

float StartDelay [get, set]
 Start delay in seconds. More...
 
bool IsPlaying [get]
 Determines whether the Particle System is playing. More...
 
bool IsEmitting [get]
 
bool IsStopped [get]
 Determines whether the Particle System is in the stopped state. More...
 
bool IsPaused [get]
 Determines whether the Particle System is paused. More...
 
bool Loop [get, set]
 Specifies whether the Particle System is looping. More...
 
bool PlayOnAwake [get, set]
 If set to true, the Particle System automatically begins to play on startup. More...
 
float Time [get, set]
 Playback position in seconds. More...
 
float Duration [get]
 The duration of the Particle System in seconds. More...
 
float PlaybackSpeed [get, set]
 Override the default playback speed of the Particle System. More...
 
int ParticleCount [get]
 The current number of particles (Read Only). More...
 
bool EnableEmission [get, set]
 Specifies whether emission is enabled or disabled. More...
 
float EmissionRate [get, set]
 
float EmissionRateOverTime [get, set]
 The rate at which the emitter spawns’new particles over time. More...
 
float EmissionRateOverDistance [get, set]
 The rate at which the emitter spawns’new particles over distance. More...
 
float StartSpeed [get, set]
 The initial speed of particles when the Particle System first spawns them. More...
 
float StartSize [get, set]
 The initial size of particles when the Particle System first spawns them. More...
 
SColor StartColor [get, set]
 The initial color of particles when the Particle System first spawns them. More...
 
SColor StartColorMin [get, set]
 The lower bound of the initial color of particles when the Particle System first spawns them. Only applies when when particle start color mode is set to random color. More...
 
SColor StartColorMax [get, set]
 The upper bound of the initial color of particles when the Particle System first spawns them. Only applies when when particle start color mode is set to random color. More...
 
float StartRotation [get, set]
 The initial rotation of particles when the Particle System first spawns them. More...
 
SVector StartRotation3D [get, set]
 The initial rotation of particles when the Particle System first spawns them. Using 3D vector to rotate. More...
 
float StartLifetime [get, set]
 The total lifetime in seconds that each new particle has. More...
 
float GravityModifier [get, set]
 A scale that this Particle System applies to gravity, defined by Physics.gravity. More...
 
int MaxParticles [get, set]
 The maximum number of particles to emit. More...
 
uint RandomSeed [get, set]
 Override the random seed used for the Particle System emission. (Only take effect after UseAutoRandomSeed set to false) More...
 
bool UseAutoRandomSeed [get, set]
 Controls whether the Particle System uses an automatically-generated random number to seed the random number generator. More...
 
- Properties inherited from ScriptClassComponent< ParticleSystem >
SGameObject GameObject [get]
 Return the GameObject which component added. More...
 

Member Function Documentation

◆ Clear() [1/2]

void SineSpace.Scripting.Components.SParticleSystem.Clear ( )

◆ Clear() [2/2]

void SineSpace.Scripting.Components.SParticleSystem.Clear ( bool  withChildren)

Remove all particles in the Particle System.

&ndash;get particle object and get the particle system component on it.
<br>
spawningparticles = Space.Scene.Find("Particles")
particles=spawningparticles.ParticleSystem
&ndash;remove all particles, parameter you passed to decide whether clear children as well.
particles.Clear(true)

◆ Emit()

void SineSpace.Scripting.Components.SParticleSystem.Emit ( int  count)

Emit count particles immediately.

&ndash;get particle object and get the particle system component on it.
<br>
spawningparticles = Space.Scene.Find("Particles")
particles=spawningparticles.ParticleSystem
&ndash;set max particles to 100 and emit 20 particles
particles.MaxParticles = 100
particles.Emit(20)

◆ GetTriggerParticles()

SParticle [] SineSpace.Scripting.Components.SParticleSystem.GetTriggerParticles ( SParticleSystemTriggerEventType  type)

◆ IsAlive()

bool SineSpace.Scripting.Components.SParticleSystem.IsAlive ( bool  withChildren)

Does the Particle System contain any live particles, or will it produce more?

&ndash;get particle object and get the particle system component on it.
<br>
spawningparticles = Space.Scene.Find("Particles")
particles=spawningparticles.ParticleSystem
&ndash;output whether particle system contains live particles or active to procedure particles.
Space.Log(particles.IsAlive(true))

◆ Pause() [1/2]

void SineSpace.Scripting.Components.SParticleSystem.Pause ( )

◆ Pause() [2/2]

void SineSpace.Scripting.Components.SParticleSystem.Pause ( bool  withChildren)

Pauses the system so no new particles are emitted and the existing particles are not updated.

&ndash;get particle object and get the particle system component on it.
<br>
spawningparticles = Space.Scene.Find("Particles")
particles=spawningparticles.ParticleSystem
&ndash;pause particle system, parameter you passed to decide whether pause children as well.
particles.Pause(true)

◆ Play() [1/2]

void SineSpace.Scripting.Components.SParticleSystem.Play ( )

◆ Play() [2/2]

void SineSpace.Scripting.Components.SParticleSystem.Play ( bool  withChildren)

Starts the Particle System.

&ndash;get particle object and get the particle system component on it.
<br>
spawningparticles = Space.Scene.Find("Particles")
particles=spawningparticles.ParticleSystem
&ndash;start particle system to play, you can give a bool parameter to decide whether play children as
particles.Play(true)

◆ SetTriggerParticles()

void SineSpace.Scripting.Components.SParticleSystem.SetTriggerParticles ( SParticleSystemTriggerEventType  type,
SParticle[]  sp 
)

◆ Simulate()

void SineSpace.Scripting.Components.SParticleSystem.Simulate ( float  time)

Fast-forwards the Particle System by simulating particles over the given period of time, then pauses it.

&ndash;get particle object and get the particle system component on it.
<br>
spawningparticles = Space.Scene.Find("Particles")
particles=spawningparticles.ParticleSystem
&ndash;similate to 3 seconds and pause
particles.Simulate(3)

◆ Stop() [1/2]

void SineSpace.Scripting.Components.SParticleSystem.Stop ( )

◆ Stop() [2/2]

void SineSpace.Scripting.Components.SParticleSystem.Stop ( bool  withChildren)

Stops playing the Particle System using the supplied stop behavior.

&ndash;get particle object and get the particle system component on it.
<br>
spawningparticles = Space.Scene.Find("Particles")
particles=spawningparticles.ParticleSystem
&ndash;stop particle system, you can give a bool parameter to decide whether stop children as well.
particles.Stop(true)

Property Documentation

◆ Duration

float SineSpace.Scripting.Components.SParticleSystem.Duration
get

The duration of the Particle System in seconds.

&ndash;get particle object and get the particle system component on it.
<br>
spawningparticles = Space.Scene.Find("Particles")
particles=spawningparticles.ParticleSystem
&ndash;subscribe to update, to output duration per frame
function OutputDuration()
Space.Log(particles.Duration)
end
spawningparticles.SubscribeToEvents()
spawningparticles.OnUpdate(OutputDuration)
particles.Play()

◆ EmissionRate

float SineSpace.Scripting.Components.SParticleSystem.EmissionRate
getset

◆ EmissionRateOverDistance

float SineSpace.Scripting.Components.SParticleSystem.EmissionRateOverDistance
getset

The rate at which the emitter spawns’new particles over distance.

&ndash;get particle object and get the particle system component on it.
<br>
spawningparticles = Space.Scene.Find("Particles")
particles=spawningparticles.ParticleSystem
&ndash;set emission rate overtime to 10
particles.EmisstionRateOverDistance = 10

◆ EmissionRateOverTime

float SineSpace.Scripting.Components.SParticleSystem.EmissionRateOverTime
getset

The rate at which the emitter spawns’new particles over time.

&ndash;get particle object and get the particle system component on it.
<br>
spawningparticles = Space.Scene.Find("Particles")
particles=spawningparticles.ParticleSystem
&ndash;set emission rate overtime to 10
particles.EmissionRateOverTime = 10

◆ EnableEmission

bool SineSpace.Scripting.Components.SParticleSystem.EnableEmission
getset

Specifies whether emission is enabled or disabled.

&ndash;get particle object and get the particle system component on it.
<br>
spawningparticles = Space.Scene.Find("Particles")
particles=spawningparticles.ParticleSystem
&ndash;disable emission
particles.EnableEmission = false

◆ GravityModifier

float SineSpace.Scripting.Components.SParticleSystem.GravityModifier
getset

A scale that this Particle System applies to gravity, defined by Physics.gravity.

&ndash;get particle object and get the particle system component on it.
<br>
spawningparticles = Space.Scene.Find("Particles")
particles=spawningparticles.ParticleSystem
&ndash;set gravity modifier to 1, as normal gravity
particles.GravityModifier = 1

◆ IsEmitting

bool SineSpace.Scripting.Components.SParticleSystem.IsEmitting
get

Determines whether the Particle System is emitting particles. A Particle System may stop emitting when its emission module has finished, it has been paused or if the system has been stopped using Stop with the StopEmitting flag. Resume emitting by calling Play.

&ndash;get particle object and get the particle system component on it.
<br>
spawningparticles = Space.Scene.Find("Particles")
particles=spawningparticles.ParticleSystem
&ndash;stop particle system and output emitting status
particles.Pause(true)
Space.Log(particles.IsEmitting)

◆ IsPaused

bool SineSpace.Scripting.Components.SParticleSystem.IsPaused
get

Determines whether the Particle System is paused.

&ndash;get particle object and get the particle system component on it.
<br>
spawningparticles = Space.Scene.Find("Particles")
particles=spawningparticles.ParticleSystem
&ndash;pause particles and output particle is paused status
particles.Pause(true)
Space.Log(particles.IsPaused)

◆ IsPlaying

bool SineSpace.Scripting.Components.SParticleSystem.IsPlaying
get

Determines whether the Particle System is playing.

&ndash;get particle object and get the particle system component on it.
<br>
spawningparticles = Space.Scene.Find("Particles")
particles=spawningparticles.ParticleSystem
&ndash;output is playing status
Space.Log(particles.IsPlaying)

◆ IsStopped

bool SineSpace.Scripting.Components.SParticleSystem.IsStopped
get

Determines whether the Particle System is in the stopped state.

&ndash;get particle object and get the particle system component on it.
<br>
spawningparticles = Space.Scene.Find("Particles")
particles=spawningparticles.ParticleSystem
&ndash;stop particles and output particle is stopped status
particles.Stop(true)
Space.Log(particles.IsStopped)

◆ Loop

bool SineSpace.Scripting.Components.SParticleSystem.Loop
getset

Specifies whether the Particle System is looping.

&ndash;get particle object and get the particle system component on it.
<br>
spawningparticles = Space.Scene.Find("Particles")
particles=spawningparticles.ParticleSystem
&ndash;set particle system looping to false
particles.Loop = false

◆ MaxParticles

int SineSpace.Scripting.Components.SParticleSystem.MaxParticles
getset

The maximum number of particles to emit.

&ndash;get particle object and get the particle system component on it.
<br>
spawningparticles = Space.Scene.Find("Particles")
particles=spawningparticles.ParticleSystem
&ndash;set max particles to 100
particles.MaxParticles = 100

◆ ParticleCount

int SineSpace.Scripting.Components.SParticleSystem.ParticleCount
get

The current number of particles (Read Only).

&ndash;get particle object and get the particle system component on it.
<br>
spawningparticles = Space.Scene.Find("Particles")
particles=spawningparticles.ParticleSystem
&ndash;set a coroutine to check out particle count per period
local function ToCheckParticleCount()
coroutine.yield(10)
Space.Log(particles.ParticleCount)
end
Space.Host.StartCoroutine(ToCheckParticleCount)

◆ PlaybackSpeed

float SineSpace.Scripting.Components.SParticleSystem.PlaybackSpeed
getset

Override the default playback speed of the Particle System.

&ndash;get particle object and get the particle system component on it.
<br>
spawningparticles = Space.Scene.Find("Particles")
particles=spawningparticles.ParticleSystem
&ndash;set playback speed to 2
particles.PlaybackSpeed = 2

◆ PlayOnAwake

bool SineSpace.Scripting.Components.SParticleSystem.PlayOnAwake
getset

If set to true, the Particle System automatically begins to play on startup.

&ndash;get particle object and get the particle system component on it.
<br>
spawningparticles = Space.Scene.Find("Particles")
particles=spawningparticles.ParticleSystem
&ndash;disable play on awake
particles.PlayOnAwake = false

◆ RandomSeed

uint SineSpace.Scripting.Components.SParticleSystem.RandomSeed
getset

Override the random seed used for the Particle System emission. (Only take effect after UseAutoRandomSeed set to false)

&ndash;get particle object and get the particle system component on it.
<br>
spawningparticles = Space.Scene.Find("Particles")
particles=spawningparticles.ParticleSystem
&ndash;set random seed
particles.UseAutoRandomSeed = false
particles.RandomSeed = 123456

◆ StartColor

SColor SineSpace.Scripting.Components.SParticleSystem.StartColor
getset

The initial color of particles when the Particle System first spawns them.

&ndash;get particle object and get the particle system component on it.
<br>
spawningparticles = Space.Scene.Find("Particles")
particles=spawningparticles.ParticleSystem
&ndash;set start color as pure red
particles.StartColor = Color.New(1,0,0,1)

◆ StartColorMax

SColor SineSpace.Scripting.Components.SParticleSystem.StartColorMax
getset

The upper bound of the initial color of particles when the Particle System first spawns them. Only applies when when particle start color mode is set to random color.

&ndash;get particle object and get the particle system component on it.
<br>
spawningparticles = Space.Scene.Find("Particles")
particles=spawningparticles.ParticleSystem
&ndash;set start color upper bound as pure blue
particles.StartColorMin = Color.New(0,0,1,1)

◆ StartColorMin

SColor SineSpace.Scripting.Components.SParticleSystem.StartColorMin
getset

The lower bound of the initial color of particles when the Particle System first spawns them. Only applies when when particle start color mode is set to random color.

&ndash;get particle object and get the particle system component on it.
<br>
spawningparticles = Space.Scene.Find("Particles")
particles=spawningparticles.ParticleSystem
&ndash;set start color lower bound as pure red
particles.StartColorMin = Color.New(1,0,0,1)

◆ StartDelay

float SineSpace.Scripting.Components.SParticleSystem.StartDelay
getset

Start delay in seconds.

&ndash;get particle object and get the particle system component on it.
<br>
spawningparticles = Space.Scene.Find("Particles")
particles=spawningparticles.ParticleSystem
&ndash;set start delay property to 5.
particles.StartDelay = 5

◆ StartLifetime

float SineSpace.Scripting.Components.SParticleSystem.StartLifetime
getset

The total lifetime in seconds that each new particle has.

&ndash;get particle object and get the particle system component on it.
<br>
spawningparticles = Space.Scene.Find("Particles")
particles=spawningparticles.ParticleSystem
&ndash;set start lifetime to 20 seconds
particles.StartLifetime = 20

◆ StartRotation

float SineSpace.Scripting.Components.SParticleSystem.StartRotation
getset

The initial rotation of particles when the Particle System first spawns them.

&ndash;get particle object and get the particle system component on it.
<br>
spawningparticles = Space.Scene.Find("Particles")
particles=spawningparticles.ParticleSystem
&ndash;set start rotation to 90 degrees
particles.StartRotation = 90

◆ StartRotation3D

SVector SineSpace.Scripting.Components.SParticleSystem.StartRotation3D
getset

The initial rotation of particles when the Particle System first spawns them. Using 3D vector to rotate.

&ndash;get particle object and get the particle system component on it.
<br>
spawningparticles = Space.Scene.Find("Particles")
particles=spawningparticles.ParticleSystem
&ndash;set start rotation to 90 degrees of Y axis and 90 degrees of Z axis
particles.StartRotation3D = Vector.New(0,90,90)

◆ StartSize

float SineSpace.Scripting.Components.SParticleSystem.StartSize
getset

The initial size of particles when the Particle System first spawns them.

&ndash;get particle object and get the particle system component on it.
<br>
spawningparticles = Space.Scene.Find("Particles")
particles=spawningparticles.ParticleSystem
&ndash;set start size to 10
particles.StartSize = 10

◆ StartSpeed

float SineSpace.Scripting.Components.SParticleSystem.StartSpeed
getset

The initial speed of particles when the Particle System first spawns them.

&ndash;get particle object and get the particle system component on it.
<br>
spawningparticles = Space.Scene.Find("Particles")
particles=spawningparticles.ParticleSystem
&ndash;set start speed to 10
particles.StartSpeed = 10

◆ Time

float SineSpace.Scripting.Components.SParticleSystem.Time
getset

Playback position in seconds.

&ndash;get particle object and get the particle system component on it.
<br>
spawningparticles = Space.Scene.Find("Particles")
particles=spawningparticles.ParticleSystem
&ndash;particle start to play at seconds 2
particles.Play(true)
particles.Time= 2

◆ UseAutoRandomSeed

bool SineSpace.Scripting.Components.SParticleSystem.UseAutoRandomSeed
getset

Controls whether the Particle System uses an automatically-generated random number to seed the random number generator.

&ndash;get particle object and get the particle system component on it.
<br>
spawningparticles = Space.Scene.Find("Particles")
particles=spawningparticles.ParticleSystem
&ndash;disable UseAutoRandomSeed
particles.UseAutoRandomSeed = false
SineSpace.Scripting.Components.SParticleSystem.Duration
float Duration
The duration of the Particle System in seconds.
Definition: SParticleSystem.cs:296
SineSpace.Scripting.Components.SParticleSystem.Play
void Play()
Definition: SParticleSystem.cs:816
SineSpace.Scripting.Components.SParticleSystem.ParticleCount
int ParticleCount
The current number of particles (Read Only).
Definition: SParticleSystem.cs:354
SineSpace.Scripting.Components.SParticleSystem.UseAutoRandomSeed
bool UseAutoRandomSeed
Controls whether the Particle System uses an automatically-generated random number to seed the random...
Definition: SParticleSystem.cs:778