Particle Playground - Script Reference  3.0.1
Framework for controlling particles in the Unity Engine.
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events
ParticlePlayground.PlaygroundTrails Class Reference
Inheritance diagram for ParticlePlayground.PlaygroundTrails:

Public Member Functions

PlaygroundEventC GetBirthEvent ()
 Gets the birth event this Playground Trail is listening to. More...
 
PlaygroundEventC GetDeathEvent ()
 Gets the death event this Playground Trail is listening to. More...
 
PlaygroundEventC GetCollisionEvent ()
 Gets the collision event this Playground Trail is listening to. More...
 
void AddRequiredParticleEvents ()
 Adds the required particle events to track particles. More...
 
void RemoveRequiredEvents ()
 Removes the required events to track particles. More...
 
PlaygroundEventC GetEventFromType (EVENTTYPEC eventType)
 Gets the type of event based on the passed in EVETTTYPEC. More...
 
Keyframe[] DefaultWidthKeys ()
 Returns a default pair of AnimationCurve Keyframes in X 0 and X 1 at value Y 1. More...
 
void SetMaterial (Material material)
 Sets the material of all trails. More...
 
float EvaluateWidth (float normalizedTime)
 Evaluates the width at normalized trail time. More...
 
Color32 EvaluateColor (float normalizedTime)
 
Color32 EvaluateColor (int trailIndex, int trailPointIndex)
 
void AddTrail (TrailParticleInfo particleInfo)
 Creates a trail and assigns it to a particle. More...
 
int GetOldestTrailWithParticleId (int particleId)
 Gets the oldest trail following the particle id. If the trail is already dead or doesn't contain the particle id -1 will be returned. More...
 
int GetNewestTrailWithParticleId (int particleId)
 Gets the newest trail following the particle id. If the trail is already dead or doesn't contain the particle id -1 will be returned. More...
 
Transform GetParentTransform ()
 Gets the cached parent transform of the trails. More...
 
GameObject GetParentGameObject ()
 Gets the cached parent game object of the trails. More...
 
void StopTrail (int trailNumber)
 Stopping the trail will make the trail stop following its assigned particle. More...
 
void StopOldestTrailWithParticleId (int particleId)
 Stops the oldest trail with particle identifier. More...
 
void StopNewestTrailWithParticleId (int particleId)
 Stops the newest trail with particle identifier. More...
 
void ResetTrails ()
 Resets all trails. More...
 
void RemoveTrail (int index)
 Removes the trail at index. More...
 
void DestroyAllTrails ()
 Destroys all trails and clears out trail list. More...
 

Public Attributes

PlaygroundParticlesC playgroundSystem
 The particle system this Playground Trail will follow. More...
 
Material material
 The material of each trail. More...
 
Gradient lifetimeColor = new Gradient()
 The lifetime color of all trails. More...
 
AnimationCurve pointArrayAlpha
 The point array alpha determines the alpha level over the trail points. This is a normalized value where 1 on the x-axis means all points, 1 on the y-axis means full alpha. More...
 
TrailColorMode colorMode
 The mode to color the trails with. If TrailColorMode.Lifetime is selected the coloring will be based on each point's lifetime. If TrailColorMode.PointArray is selected the coloring will be based on the points in the array. More...
 
TrailUvMode uvMode
 The uv mode. More...
 
TrailRenderMode renderMode
 Determines the render mode of the trail. This sets the rotation direction of the trail points. More...
 
Transform billboardTransform
 The transform to billboard towards if renderMode is set to TrailRenderMode.Billboard. If none is set this will default to the Main Camera transform. More...
 
Vector3 customRenderScale = Vector3.one
 The custom render scale if renderMode is set to TrailRenderMode.CustomRenderScale. This ables you to set the normal direction (with multiplier) of the trails. More...
 
float time = 3f
 The time vertices is living on the trail (determines length). More...
 
AnimationCurve timeWidth
 The width over normalized lifetime. More...
 
float widthScale = .1f
 The scale of start- and end width. More...
 
float minVertexDistance = .1f
 The minimum distance before new vertices can be created. More...
 
float maxVertexDistance = 100f
 The maximum distance before forcing new vertices. More...
 
float maxPathDeviation = 1f
 The maximum forward path deviation before forcing new vertices. More...
 
bool createPointsOnCollision = false
 Determines if points should be created upon particle collision. More...
 
int maxPoints = 100
 The maximum available points able to be created by this Playground Trail. This will determine the generation of built-in arrays needed to remain efficient in memory consumption. The trail is made out of points where vertices are drawn in between, two points is the minimum to be able to draw a trail, this represents 4 vertices and 6 triangles. More...
 
bool createFirstPointOnParticleBirth = false
 Determines if first point should be created immediately on particle birth, otherwise this will be created during the trail calculation routine. This has affect on when the trail starts as the particle may have moved when the first point is created. If your particle source is moving you may want to leave this setting off to not create a first skewed trail point. More...
 
bool createLastPointOnParticleDeath = false
 Determines if a last point on the trail should be created when its assigned particle dies. More...
 
bool multithreading = true
 Determines if the Playground Trails should run asynchronously on a separate thread. This will go through the selected Thread Pool Method in the Playground Manager (PlaygroundC). More...
 
PlaygroundEventC birthEvent
 The reference to the birth event on the assigned Particle Playground system. More...
 
PlaygroundEventC deathEvent
 The reference to the death event on the assigned Particle Playground system. More...
 
PlaygroundEventC collisionEvent
 The reference to the collision event on the assigned Particle Playground system. More...
 
Transform parentTransform
 
GameObject parentGameObject
 

Member Function Documentation

void ParticlePlayground.PlaygroundTrails.AddRequiredParticleEvents ( )

Adds the required particle events to track particles.

void ParticlePlayground.PlaygroundTrails.AddTrail ( TrailParticleInfo  particleInfo)

Creates a trail and assigns it to a particle.

Parameters
particleInfoInformation about the particle.
Keyframe [] ParticlePlayground.PlaygroundTrails.DefaultWidthKeys ( )

Returns a default pair of AnimationCurve Keyframes in X 0 and X 1 at value Y 1.

Returns
The default width keys.
void ParticlePlayground.PlaygroundTrails.DestroyAllTrails ( )

Destroys all trails and clears out trail list.

float ParticlePlayground.PlaygroundTrails.EvaluateWidth ( float  normalizedTime)

Evaluates the width at normalized trail time.

Returns
The width at normalized trail time.
Parameters
normalizedTimeNormalized time.
PlaygroundEventC ParticlePlayground.PlaygroundTrails.GetBirthEvent ( )

Gets the birth event this Playground Trail is listening to.

Returns
The particle birth event.
PlaygroundEventC ParticlePlayground.PlaygroundTrails.GetCollisionEvent ( )

Gets the collision event this Playground Trail is listening to.

Returns
The particle collision event.
PlaygroundEventC ParticlePlayground.PlaygroundTrails.GetDeathEvent ( )

Gets the death event this Playground Trail is listening to.

Returns
The particle death event.
PlaygroundEventC ParticlePlayground.PlaygroundTrails.GetEventFromType ( EVENTTYPEC  eventType)

Gets the type of event based on the passed in EVETTTYPEC.

Returns
The event of type specified.
Parameters
eventTypeThe event type.
int ParticlePlayground.PlaygroundTrails.GetNewestTrailWithParticleId ( int  particleId)

Gets the newest trail following the particle id. If the trail is already dead or doesn't contain the particle id -1 will be returned.

Returns
The trail with particle id (-1 if not found).
Parameters
particleIdParticle identifier.
int ParticlePlayground.PlaygroundTrails.GetOldestTrailWithParticleId ( int  particleId)

Gets the oldest trail following the particle id. If the trail is already dead or doesn't contain the particle id -1 will be returned.

Returns
The trail with particle id (-1 if not found).
Parameters
particleIdParticle identifier.
GameObject ParticlePlayground.PlaygroundTrails.GetParentGameObject ( )

Gets the cached parent game object of the trails.

Returns
The parent game object.
Transform ParticlePlayground.PlaygroundTrails.GetParentTransform ( )

Gets the cached parent transform of the trails.

Returns
The parent transform.
void ParticlePlayground.PlaygroundTrails.RemoveRequiredEvents ( )

Removes the required events to track particles.

void ParticlePlayground.PlaygroundTrails.RemoveTrail ( int  index)

Removes the trail at index.

Parameters
indexThe trail index.
void ParticlePlayground.PlaygroundTrails.ResetTrails ( )

Resets all trails.

void ParticlePlayground.PlaygroundTrails.SetMaterial ( Material  material)

Sets the material of all trails.

Parameters
materialThe material all trails should get.
void ParticlePlayground.PlaygroundTrails.StopNewestTrailWithParticleId ( int  particleId)

Stops the newest trail with particle identifier.

Parameters
particleIdParticle identifier.
void ParticlePlayground.PlaygroundTrails.StopOldestTrailWithParticleId ( int  particleId)

Stops the oldest trail with particle identifier.

Parameters
particleIdParticle identifier.
void ParticlePlayground.PlaygroundTrails.StopTrail ( int  trailNumber)

Stopping the trail will make the trail stop following its assigned particle.

Parameters
trailNumberTrail number.

Member Data Documentation

Transform ParticlePlayground.PlaygroundTrails.billboardTransform

The transform to billboard towards if renderMode is set to TrailRenderMode.Billboard. If none is set this will default to the Main Camera transform.

PlaygroundEventC ParticlePlayground.PlaygroundTrails.birthEvent

The reference to the birth event on the assigned Particle Playground system.

PlaygroundEventC ParticlePlayground.PlaygroundTrails.collisionEvent

The reference to the collision event on the assigned Particle Playground system.

TrailColorMode ParticlePlayground.PlaygroundTrails.colorMode

The mode to color the trails with. If TrailColorMode.Lifetime is selected the coloring will be based on each point's lifetime. If TrailColorMode.PointArray is selected the coloring will be based on the points in the array.

bool ParticlePlayground.PlaygroundTrails.createFirstPointOnParticleBirth = false

Determines if first point should be created immediately on particle birth, otherwise this will be created during the trail calculation routine. This has affect on when the trail starts as the particle may have moved when the first point is created. If your particle source is moving you may want to leave this setting off to not create a first skewed trail point.

bool ParticlePlayground.PlaygroundTrails.createLastPointOnParticleDeath = false

Determines if a last point on the trail should be created when its assigned particle dies.

bool ParticlePlayground.PlaygroundTrails.createPointsOnCollision = false

Determines if points should be created upon particle collision.

Vector3 ParticlePlayground.PlaygroundTrails.customRenderScale = Vector3.one

The custom render scale if renderMode is set to TrailRenderMode.CustomRenderScale. This ables you to set the normal direction (with multiplier) of the trails.

PlaygroundEventC ParticlePlayground.PlaygroundTrails.deathEvent

The reference to the death event on the assigned Particle Playground system.

Gradient ParticlePlayground.PlaygroundTrails.lifetimeColor = new Gradient()

The lifetime color of all trails.

Material ParticlePlayground.PlaygroundTrails.material

The material of each trail.

float ParticlePlayground.PlaygroundTrails.maxPathDeviation = 1f

The maximum forward path deviation before forcing new vertices.

int ParticlePlayground.PlaygroundTrails.maxPoints = 100

The maximum available points able to be created by this Playground Trail. This will determine the generation of built-in arrays needed to remain efficient in memory consumption. The trail is made out of points where vertices are drawn in between, two points is the minimum to be able to draw a trail, this represents 4 vertices and 6 triangles.

float ParticlePlayground.PlaygroundTrails.maxVertexDistance = 100f

The maximum distance before forcing new vertices.

float ParticlePlayground.PlaygroundTrails.minVertexDistance = .1f

The minimum distance before new vertices can be created.

bool ParticlePlayground.PlaygroundTrails.multithreading = true

Determines if the Playground Trails should run asynchronously on a separate thread. This will go through the selected Thread Pool Method in the Playground Manager (PlaygroundC).

PlaygroundParticlesC ParticlePlayground.PlaygroundTrails.playgroundSystem

The particle system this Playground Trail will follow.

AnimationCurve ParticlePlayground.PlaygroundTrails.pointArrayAlpha

The point array alpha determines the alpha level over the trail points. This is a normalized value where 1 on the x-axis means all points, 1 on the y-axis means full alpha.

TrailRenderMode ParticlePlayground.PlaygroundTrails.renderMode

Determines the render mode of the trail. This sets the rotation direction of the trail points.

float ParticlePlayground.PlaygroundTrails.time = 3f

The time vertices is living on the trail (determines length).

AnimationCurve ParticlePlayground.PlaygroundTrails.timeWidth

The width over normalized lifetime.

TrailUvMode ParticlePlayground.PlaygroundTrails.uvMode

The uv mode.

float ParticlePlayground.PlaygroundTrails.widthScale = .1f

The scale of start- and end width.


The documentation for this class was generated from the following file: