Particle Playground - Script Reference
3.0.1
Framework for controlling particles in the Unity Engine.
|
Public Member Functions | |
ParticlePlaygroundTrail () | |
Initializes a new instance of the ParticlePlayground.ParticlePlaygroundTrail class. More... | |
ParticlePlaygroundTrail (int pointCache) | |
Initializes a new instance of the ParticlePlayground.ParticlePlaygroundTrail class and specifies the available point cache. The mesh's available vertices, normals, uvs, triangles and colors will be based on the specified point cache. More... | |
void | UpdateCache () |
Updates the mesh cache. This is done upon creation where cache lengths will be based on the point cache. More... | |
void | UpdateMesh () |
Updates the trail mesh. This is done each frame from the main-thread. More... | |
void | RecalculateBounds () |
Recalculates the bounds on the trail mesh. This is done automatically when triangles are set into a mesh. More... | |
void | ClearMesh () |
Clears the trail mesh. More... | |
void | SetFirstPoint (Vector3 pos, Vector3 dir, float startWidth, float lifetime) |
Sets the first point in the trail. This will add two initial points, one starting point and one ending point which will follow the assigned particle. More... | |
void | SetLastPoint (Vector3 pos, Vector3 dir, float startWidth, float lifetime) |
Sets the last point in the trail and then kills it. This will add one last point which won't follow the assigned particle. More... | |
void | AddPoint (Vector3 position, float width, float lifetime) |
Adds a point into the end of the trail. More... | |
void | AddPoint (Vector3 position, Vector3 velocity, float width, float lifetime) |
Adds a point into the end of the trail. More... | |
void | RemovePoint (int index) |
void | SetColor (int index, Color32 color) |
Sets the color at specified index. This is done automatically through the trail calculation loop. More... | |
void | NextPoint () |
Makes the iterator jump to next point. The iterator controls which point is following the particle. More... | |
float | GetParticleTime () |
Gets the paired particle's current time. More... | |
void | SetParticleTime (float time) |
Sets the paired particle's current time. More... | |
Vector3 | GetParticlePosition () |
Gets the paired particle's current position. More... | |
void | SetParticlePosition (Vector3 position) |
Sets the paired particle's position. More... | |
void | SetParticleDirection (Vector3 direction) |
Sets the paired particle's direction. More... | |
Vector3 | GetLastAddedPointPosition () |
Gets the last added point position. More... | |
Vector3 | GetParticleDirection () |
Gets the direction of the particle. More... | |
Vector3 | GetLastAddedPointDirection () |
float | GetPathDeviation () |
Gets the current path deviation angle based on the last added point direction and the current direction of the particle. More... | |
int | GetBirthIterator () |
Gets the birth iterator used for iterating through the mesh arrays to set new vertex positions. More... | |
int | GetDeathIterator () |
Gets the death iterator used for iterating through the mesh arrays to remove old vertex positions. More... | |
int | GetPointCache () |
Gets the point cache amount. The point cache is set at the trail's creation and determines how many vertices, triangles, uvs, normals and colors the trail mesh can have. More... | |
float | TimeCached () |
Gets the time this trail was cached. More... | |
bool | CanRemovePoint (int point) |
Determines whether this trail can remove a point at specified index. More... | |
bool | CanRemoveTrail () |
Determines whether this trail can be removed. This will check if the last point in the trail has reached the end of its lifetime. More... | |
void | WakeUp () |
Wakes up the trail from being dead. More... | |
void | Die () |
Makes the trail stop following its assigned particle. More... | |
bool | IsDead () |
Determines whether this trail is dead. More... | |
Public Attributes | |
bool | update = true |
Determines if this ParticlePlaygroundTrail should update. More... | |
GameObject | trailGameObject |
The GameObject of this trail. More... | |
Transform | trailTransform |
The Transform of this trail. More... | |
MeshRenderer | trailRenderer |
The Mesh Renderer component of this trail. More... | |
MeshFilter | trailMeshFilter |
The Mesh Filter component of this trail. More... | |
Mesh | trailMesh |
The Mesh component of this trail. More... | |
int | particleId |
The particle this trail is following. More... | |
int | minPointCache = 2 |
The minimum point cache limit. More... | |
int | maxPointCache = 32767 |
The maximum point cache limit. More... | |
List< TrailPoint > | trailPoints = new List<TrailPoint>() |
Vector3[] | meshVerticesCache |
Vector3[] | meshNormalsCache |
Vector2[] | meshUvsCache |
int[] | meshTrianglesCache |
Color32[] | meshColorsCache |
ParticlePlayground.ParticlePlaygroundTrail.ParticlePlaygroundTrail | ( | ) |
Initializes a new instance of the ParticlePlayground.ParticlePlaygroundTrail class.
ParticlePlayground.ParticlePlaygroundTrail.ParticlePlaygroundTrail | ( | int | pointCache | ) |
Initializes a new instance of the ParticlePlayground.ParticlePlaygroundTrail class and specifies the available point cache. The mesh's available vertices, normals, uvs, triangles and colors will be based on the specified point cache.
pointCache | Mesh point cache (vertices, normals and uvs will be multiplied by two, triangles by six). |
void ParticlePlayground.ParticlePlaygroundTrail.AddPoint | ( | Vector3 | position, |
float | width, | ||
float | lifetime | ||
) |
Adds a point into the end of the trail.
position | Position. |
width | Width. |
lifetime | Lifetime. |
void ParticlePlayground.ParticlePlaygroundTrail.AddPoint | ( | Vector3 | position, |
Vector3 | velocity, | ||
float | width, | ||
float | lifetime | ||
) |
Adds a point into the end of the trail.
position | Position. |
velocity | Initial Velocity. |
width | Width. |
lifetime | Lifetime. |
bool ParticlePlayground.ParticlePlaygroundTrail.CanRemovePoint | ( | int | point | ) |
Determines whether this trail can remove a point at specified index.
true
if this trail can remove a point at the specified index; otherwise, false
.point | Point. |
bool ParticlePlayground.ParticlePlaygroundTrail.CanRemoveTrail | ( | ) |
Determines whether this trail can be removed. This will check if the last point in the trail has reached the end of its lifetime.
true
if this trail can be removed; otherwise, false
.void ParticlePlayground.ParticlePlaygroundTrail.ClearMesh | ( | ) |
Clears the trail mesh.
void ParticlePlayground.ParticlePlaygroundTrail.Die | ( | ) |
Makes the trail stop following its assigned particle.
int ParticlePlayground.ParticlePlaygroundTrail.GetBirthIterator | ( | ) |
Gets the birth iterator used for iterating through the mesh arrays to set new vertex positions.
int ParticlePlayground.ParticlePlaygroundTrail.GetDeathIterator | ( | ) |
Gets the death iterator used for iterating through the mesh arrays to remove old vertex positions.
Vector3 ParticlePlayground.ParticlePlaygroundTrail.GetLastAddedPointPosition | ( | ) |
Gets the last added point position.
Vector3 ParticlePlayground.ParticlePlaygroundTrail.GetParticleDirection | ( | ) |
Gets the direction of the particle.
Vector3 ParticlePlayground.ParticlePlaygroundTrail.GetParticlePosition | ( | ) |
Gets the paired particle's current position.
float ParticlePlayground.ParticlePlaygroundTrail.GetParticleTime | ( | ) |
Gets the paired particle's current time.
float ParticlePlayground.ParticlePlaygroundTrail.GetPathDeviation | ( | ) |
Gets the current path deviation angle based on the last added point direction and the current direction of the particle.
int ParticlePlayground.ParticlePlaygroundTrail.GetPointCache | ( | ) |
Gets the point cache amount. The point cache is set at the trail's creation and determines how many vertices, triangles, uvs, normals and colors the trail mesh can have.
bool ParticlePlayground.ParticlePlaygroundTrail.IsDead | ( | ) |
Determines whether this trail is dead.
true
if this trail is dead; otherwise, false
.void ParticlePlayground.ParticlePlaygroundTrail.NextPoint | ( | ) |
Makes the iterator jump to next point. The iterator controls which point is following the particle.
void ParticlePlayground.ParticlePlaygroundTrail.RecalculateBounds | ( | ) |
Recalculates the bounds on the trail mesh. This is done automatically when triangles are set into a mesh.
void ParticlePlayground.ParticlePlaygroundTrail.SetColor | ( | int | index, |
Color32 | color | ||
) |
Sets the color at specified index. This is done automatically through the trail calculation loop.
index | Index. |
color | Color. |
void ParticlePlayground.ParticlePlaygroundTrail.SetFirstPoint | ( | Vector3 | pos, |
Vector3 | dir, | ||
float | startWidth, | ||
float | lifetime | ||
) |
Sets the first point in the trail. This will add two initial points, one starting point and one ending point which will follow the assigned particle.
pos | Position. |
dir | Direction. |
startWidth | Start width. |
lifetime | Lifetime. |
void ParticlePlayground.ParticlePlaygroundTrail.SetLastPoint | ( | Vector3 | pos, |
Vector3 | dir, | ||
float | startWidth, | ||
float | lifetime | ||
) |
Sets the last point in the trail and then kills it. This will add one last point which won't follow the assigned particle.
pos | Position. |
dir | Direction. |
startWidth | Start width. |
lifetime | Lifetime. |
void ParticlePlayground.ParticlePlaygroundTrail.SetParticleDirection | ( | Vector3 | direction | ) |
Sets the paired particle's direction.
direction | Direction. |
void ParticlePlayground.ParticlePlaygroundTrail.SetParticlePosition | ( | Vector3 | position | ) |
Sets the paired particle's position.
position | Position. |
void ParticlePlayground.ParticlePlaygroundTrail.SetParticleTime | ( | float | time | ) |
Sets the paired particle's current time.
time | Time. |
float ParticlePlayground.ParticlePlaygroundTrail.TimeCached | ( | ) |
Gets the time this trail was cached.
void ParticlePlayground.ParticlePlaygroundTrail.UpdateCache | ( | ) |
Updates the mesh cache. This is done upon creation where cache lengths will be based on the point cache.
void ParticlePlayground.ParticlePlaygroundTrail.UpdateMesh | ( | ) |
Updates the trail mesh. This is done each frame from the main-thread.
void ParticlePlayground.ParticlePlaygroundTrail.WakeUp | ( | ) |
Wakes up the trail from being dead.
int ParticlePlayground.ParticlePlaygroundTrail.maxPointCache = 32767 |
The maximum point cache limit.
int ParticlePlayground.ParticlePlaygroundTrail.minPointCache = 2 |
The minimum point cache limit.
int ParticlePlayground.ParticlePlaygroundTrail.particleId |
The particle this trail is following.
GameObject ParticlePlayground.ParticlePlaygroundTrail.trailGameObject |
The GameObject of this trail.
Mesh ParticlePlayground.ParticlePlaygroundTrail.trailMesh |
The Mesh component of this trail.
MeshFilter ParticlePlayground.ParticlePlaygroundTrail.trailMeshFilter |
The Mesh Filter component of this trail.
MeshRenderer ParticlePlayground.ParticlePlaygroundTrail.trailRenderer |
The Mesh Renderer component of this trail.
Transform ParticlePlayground.ParticlePlaygroundTrail.trailTransform |
The Transform of this trail.
bool ParticlePlayground.ParticlePlaygroundTrail.update = true |
Determines if this ParticlePlaygroundTrail should update.