Particle Playground - Script Reference
3.0.1
Framework for controlling particles in the Unity Engine.
|
Holds information about a Manipulator Object. A Manipulator can both be Global and Local and will affect all particles within range. More...
Public Member Functions | |
bool | Contains (Vector3 position, Vector3 mPosition) |
Checks if manipulator contains position. The outcome is depending on if you use a sphere (size)- or box (bounds) as shape. The passed in position is your target (particle) position and the mPosition is the Manipulator's origin position. More... | |
void | SendParticleEventEnter () |
void | SendParticleEventExit () |
void | SendParticleEventBirth () |
void | SendParticleEventDeath () |
void | SendParticleEventCollision () |
PlaygroundEventParticle | GetParticle (int index) |
Gets the particle at index. Note that the Manipulator must have trackParticles set to true. More... | |
PlaygroundEventParticle | GetParticle (int particleSystemId, int particleId) |
Gets the particle in particle system at index. Note that the Manipulator must have trackParticles set to true. More... | |
List< PlaygroundEventParticle > | GetParticles () |
Gets all particles within this Manipulator. Note that the Manipulator must have trackParticles set to true. More... | |
bool | ContainsParticle (int particleSystemId, int particleId) |
Check if Manipulator contains particle of particle system. More... | |
bool | IsSameId (int compareId) |
Check if passed in id is the same as this Manipulator id. This is the fastest way to compare particles (playgroundCache.manipulatorId) to Manipulators, but will not work for overlapping areas. More... | |
bool | AddParticle (int particleSystemId, int particleId) |
Adds a particle to the list of particles. Note that the Manipulator must have tracking enabled. More... | |
bool | RemoveParticle (int particleSystemId, int particleId) |
Removes a particle from the list of particles. Note that the Manipulator must have tracking enabled. More... | |
void | KillAllParticles () |
Kills all particles within the Manipulator. Note that the Manipulator must have tracking enabled. More... | |
bool | ContainsNonAffectedParticle (int particleSystemId, int particleId) |
Check if the Manipulator contains a particle which won't be affected. More... | |
void | AddNonAffectedParticle (int particleSystemId, int particleId) |
Adds a non-affected particle. The particle won't be affected by this Manipulator. If possible, use the particle filtering methods on the Manipulator instead, they are faster to compute. More... | |
bool | RemoveNonAffectedParticle (int particleSystemId, int particleId) |
Removes the non affected particle. If possible, use the particle filtering methods on the Manipulator instead, they are faster to compute. More... | |
bool | LifetimeFilter (float life, float total) |
Check if lifetime filter will apply. More... | |
bool | ParticleFilter (int p, int total) |
Check if particle filter will apply. More... | |
void | Update () |
Update this Manipulator Object. This runs automatically each calculation loop. More... | |
void | SetTransform (Transform transform) |
Sets a new transform to this Manipulator. More... | |
void | SetLocalTargetsPosition (Transform otherTransform) |
ManipulatorObjectC | Clone () |
Return a copy of this ManipulatorObjectC. More... | |
Public Attributes | |
MANIPULATORTYPEC | type |
The type of this manipulator. More... | |
ManipulatorPropertyC | property = new ManipulatorPropertyC() |
The property settings (if type is property). More... | |
List< ManipulatorPropertyC > | properties = new List<ManipulatorPropertyC>() |
The combined properties (if type is combined). More... | |
LayerMask | affects |
The layers this manipulator will affect. This only applies to Global Manipulators. More... | |
PlaygroundTransformC | transform = new PlaygroundTransformC() |
The transform of this manipulator (wrapped class for threading). More... | |
MANIPULATORSHAPEC | shape |
The shape of this manipulator. More... | |
float | size |
The size of this manipulator (if shape is sphere). More... | |
Bounds | bounds |
The bounds of this manipulator (if shape is box). More... | |
float | strength |
The strength of this manipulator. More... | |
float | strengthSmoothing = 1f |
The scale of strength smoothing effector. More... | |
float | strengthDistanceEffect = 1f |
The scale of distance strength effector. More... | |
bool | applyParticleLifetimeStrength = false |
Determines if Particle Lifetime Strength should be applied. More... | |
AnimationCurve | particleLifetimeStrength = new AnimationCurve(new Keyframe[]{new Keyframe(0,1f), new Keyframe(1f,1f)}) |
The particle lifetime strength is defined by a normalized Animation Curve. More... | |
bool | enabled = true |
Is this manipulator enabled? More... | |
bool | inverseBounds = false |
Should this manipulator be checking for particles inside or outside the shape's bounds? More... | |
int | manipulatorId = 0 |
The id of this manipulator. More... | |
bool | applyLifetimeFilter = false |
Should lifetime filter determine which particles are affected? More... | |
float | lifetimeFilterMinimum = 0f |
The minimum normalized lifetime of a particle that is affected by this manipulator. More... | |
float | lifetimeFilterMaximum = 1f |
The maximum normalized lifetime of a particle that is affected by this manipulator. More... | |
bool | applyParticleFilter = false |
Should particle filter determine which particles are affected? More... | |
float | particleFilterMinimum = 0f |
The minimum normalized number in array of a particle that is affected by this manipulator. More... | |
float | particleFilterMaximum = 1f |
The maximum normalized number in array of a particle that is affected by this manipulator. More... | |
PlaygroundAxisConstraintsC | axisConstraints = new PlaygroundAxisConstraintsC() |
The axis constraints for this Manipulator. This enables you to set if the calculated forces should not be applied on certain axis. More... | |
bool | unfolded = false |
bool | trackParticles = false |
Should the manipulator be able to send particle events and keep track of its particles? More... | |
TrackingMethod | trackingMethod = TrackingMethod.ManipulatorId |
The tracking method when trackParticles is enabled. Using TrackingMethod.ManipulatorId will be fast, but may not return correct when having overlapping Manipulators. Using TrackingMethod.ParticleId will be slow, but will ensure correct compare of particles within any overlapping Manipulators. More... | |
bool | sendEventEnter = true |
Should enter event be sent? More... | |
bool | sendEventExit = true |
Should exit event be sent? More... | |
bool | sendEventBirth = true |
Should birth event be sent? More... | |
bool | sendEventDeath = true |
Should death event be sent? More... | |
bool | sendEventCollision = true |
Should collision event be sent? More... | |
bool | sendEventsUnfolded = false |
List< ManipulatorParticle > | particles = new List<ManipulatorParticle>() |
The current particles inside this manipulator. This requires that you have enabled trackParticles. More... | |
List< ManipulatorParticle > | nonAffectedParticles = new List<ManipulatorParticle>() |
The particles which will not be affected by this manipulator. If possible use the Manipulator's particle filtering methods instead as they are faster to compute. More... | |
PlaygroundEventParticle | manipulatorEventParticle = new PlaygroundEventParticle() |
The cached event particle used to send into events. More... | |
Events | |
OnPlaygroundParticle | particleEventEnter |
The entering event of a particle (when using Event Listeners). More... | |
OnPlaygroundParticle | particleEventExit |
The exit event of a particle (when using Event Listeners). More... | |
OnPlaygroundParticle | particleEventBirth |
The birth event of a particle (when using Event Listeners). More... | |
OnPlaygroundParticle | particleEventDeath |
The death event of a particle (when using Event Listeners). More... | |
OnPlaygroundParticle | particleEventCollision |
The collision event of a particle (when using Event Listeners). More... | |
Holds information about a Manipulator Object. A Manipulator can both be Global and Local and will affect all particles within range.
void ParticlePlayground.ManipulatorObjectC.AddNonAffectedParticle | ( | int | particleSystemId, |
int | particleId | ||
) |
Adds a non-affected particle. The particle won't be affected by this Manipulator. If possible, use the particle filtering methods on the Manipulator instead, they are faster to compute.
particleSystemId | Particle system identifier. |
particleId | Particle identifier. |
bool ParticlePlayground.ManipulatorObjectC.AddParticle | ( | int | particleSystemId, |
int | particleId | ||
) |
Adds a particle to the list of particles. Note that the Manipulator must have tracking enabled.
particleSystemId | Particle system identifier. |
particleId | Particle identifier. |
ManipulatorObjectC ParticlePlayground.ManipulatorObjectC.Clone | ( | ) |
Return a copy of this ManipulatorObjectC.
Checks if manipulator contains position. The outcome is depending on if you use a sphere (size)- or box (bounds) as shape. The passed in position is your target (particle) position and the mPosition is the Manipulator's origin position.
position | Position of target. |
mPosition | Center position of Manipulator. |
bool ParticlePlayground.ManipulatorObjectC.ContainsNonAffectedParticle | ( | int | particleSystemId, |
int | particleId | ||
) |
Check if the Manipulator contains a particle which won't be affected.
true
, if non-affected particle was found, false
otherwise.particleSystemId | Particle system identifier. |
particleId | Particle identifier. |
bool ParticlePlayground.ManipulatorObjectC.ContainsParticle | ( | int | particleSystemId, |
int | particleId | ||
) |
Check if Manipulator contains particle of particle system.
true
, if particle was found, false
otherwise.particleSystemId | Particle system identifier. |
particleId | Particle identifier. |
PlaygroundEventParticle ParticlePlayground.ManipulatorObjectC.GetParticle | ( | int | index | ) |
Gets the particle at index. Note that the Manipulator must have trackParticles set to true.
index | Index. |
PlaygroundEventParticle ParticlePlayground.ManipulatorObjectC.GetParticle | ( | int | particleSystemId, |
int | particleId | ||
) |
Gets the particle in particle system at index. Note that the Manipulator must have trackParticles set to true.
particleSystemId | Particle system identifier. |
particleId | Particle identifier. |
List<PlaygroundEventParticle> ParticlePlayground.ManipulatorObjectC.GetParticles | ( | ) |
Gets all particles within this Manipulator. Note that the Manipulator must have trackParticles set to true.
bool ParticlePlayground.ManipulatorObjectC.IsSameId | ( | int | compareId | ) |
Check if passed in id is the same as this Manipulator id. This is the fastest way to compare particles (playgroundCache.manipulatorId) to Manipulators, but will not work for overlapping areas.
true
, if same id, false
otherwise.compareId | Id to compare with. |
void ParticlePlayground.ManipulatorObjectC.KillAllParticles | ( | ) |
Kills all particles within the Manipulator. Note that the Manipulator must have tracking enabled.
bool ParticlePlayground.ManipulatorObjectC.LifetimeFilter | ( | float | life, |
float | total | ||
) |
Check if lifetime filter will apply.
true
, if filter was lifetimed, false
otherwise.life | Life. |
total | Total. |
bool ParticlePlayground.ManipulatorObjectC.ParticleFilter | ( | int | p, |
int | total | ||
) |
Check if particle filter will apply.
true
, if filter was particled, false
otherwise.p | P. |
total | Total. |
bool ParticlePlayground.ManipulatorObjectC.RemoveNonAffectedParticle | ( | int | particleSystemId, |
int | particleId | ||
) |
Removes the non affected particle. If possible, use the particle filtering methods on the Manipulator instead, they are faster to compute.
true
, if non affected particle was removed, false
otherwise.particleSystemId | Particle system identifier. |
particleId | Particle identifier. |
bool ParticlePlayground.ManipulatorObjectC.RemoveParticle | ( | int | particleSystemId, |
int | particleId | ||
) |
Removes a particle from the list of particles. Note that the Manipulator must have tracking enabled.
true
, if particle was removed, false
otherwise.particleSystemId | Particle system identifier. |
particleId | Particle identifier. |
void ParticlePlayground.ManipulatorObjectC.SetTransform | ( | Transform | transform | ) |
Sets a new transform to this Manipulator.
transform | The new Transform that should be assigned to this Manipulator. |
void ParticlePlayground.ManipulatorObjectC.Update | ( | ) |
Update this Manipulator Object. This runs automatically each calculation loop.
LayerMask ParticlePlayground.ManipulatorObjectC.affects |
The layers this manipulator will affect. This only applies to Global Manipulators.
bool ParticlePlayground.ManipulatorObjectC.applyLifetimeFilter = false |
Should lifetime filter determine which particles are affected?
bool ParticlePlayground.ManipulatorObjectC.applyParticleFilter = false |
Should particle filter determine which particles are affected?
bool ParticlePlayground.ManipulatorObjectC.applyParticleLifetimeStrength = false |
Determines if Particle Lifetime Strength should be applied.
PlaygroundAxisConstraintsC ParticlePlayground.ManipulatorObjectC.axisConstraints = new PlaygroundAxisConstraintsC() |
The axis constraints for this Manipulator. This enables you to set if the calculated forces should not be applied on certain axis.
Bounds ParticlePlayground.ManipulatorObjectC.bounds |
The bounds of this manipulator (if shape is box).
bool ParticlePlayground.ManipulatorObjectC.enabled = true |
Is this manipulator enabled?
bool ParticlePlayground.ManipulatorObjectC.inverseBounds = false |
Should this manipulator be checking for particles inside or outside the shape's bounds?
float ParticlePlayground.ManipulatorObjectC.lifetimeFilterMaximum = 1f |
The maximum normalized lifetime of a particle that is affected by this manipulator.
float ParticlePlayground.ManipulatorObjectC.lifetimeFilterMinimum = 0f |
The minimum normalized lifetime of a particle that is affected by this manipulator.
PlaygroundEventParticle ParticlePlayground.ManipulatorObjectC.manipulatorEventParticle = new PlaygroundEventParticle() |
The cached event particle used to send into events.
int ParticlePlayground.ManipulatorObjectC.manipulatorId = 0 |
The id of this manipulator.
List<ManipulatorParticle> ParticlePlayground.ManipulatorObjectC.nonAffectedParticles = new List<ManipulatorParticle>() |
The particles which will not be affected by this manipulator. If possible use the Manipulator's particle filtering methods instead as they are faster to compute.
float ParticlePlayground.ManipulatorObjectC.particleFilterMaximum = 1f |
The maximum normalized number in array of a particle that is affected by this manipulator.
float ParticlePlayground.ManipulatorObjectC.particleFilterMinimum = 0f |
The minimum normalized number in array of a particle that is affected by this manipulator.
AnimationCurve ParticlePlayground.ManipulatorObjectC.particleLifetimeStrength = new AnimationCurve(new Keyframe[]{new Keyframe(0,1f), new Keyframe(1f,1f)}) |
The particle lifetime strength is defined by a normalized Animation Curve.
List<ManipulatorParticle> ParticlePlayground.ManipulatorObjectC.particles = new List<ManipulatorParticle>() |
The current particles inside this manipulator. This requires that you have enabled trackParticles.
List<ManipulatorPropertyC> ParticlePlayground.ManipulatorObjectC.properties = new List<ManipulatorPropertyC>() |
The combined properties (if type is combined).
ManipulatorPropertyC ParticlePlayground.ManipulatorObjectC.property = new ManipulatorPropertyC() |
The property settings (if type is property).
bool ParticlePlayground.ManipulatorObjectC.sendEventBirth = true |
Should birth event be sent?
bool ParticlePlayground.ManipulatorObjectC.sendEventCollision = true |
Should collision event be sent?
bool ParticlePlayground.ManipulatorObjectC.sendEventDeath = true |
Should death event be sent?
bool ParticlePlayground.ManipulatorObjectC.sendEventEnter = true |
Should enter event be sent?
bool ParticlePlayground.ManipulatorObjectC.sendEventExit = true |
Should exit event be sent?
MANIPULATORSHAPEC ParticlePlayground.ManipulatorObjectC.shape |
The shape of this manipulator.
float ParticlePlayground.ManipulatorObjectC.size |
The size of this manipulator (if shape is sphere).
float ParticlePlayground.ManipulatorObjectC.strength |
The strength of this manipulator.
float ParticlePlayground.ManipulatorObjectC.strengthDistanceEffect = 1f |
The scale of distance strength effector.
float ParticlePlayground.ManipulatorObjectC.strengthSmoothing = 1f |
The scale of strength smoothing effector.
TrackingMethod ParticlePlayground.ManipulatorObjectC.trackingMethod = TrackingMethod.ManipulatorId |
The tracking method when trackParticles is enabled. Using TrackingMethod.ManipulatorId will be fast, but may not return correct when having overlapping Manipulators. Using TrackingMethod.ParticleId will be slow, but will ensure correct compare of particles within any overlapping Manipulators.
bool ParticlePlayground.ManipulatorObjectC.trackParticles = false |
Should the manipulator be able to send particle events and keep track of its particles?
PlaygroundTransformC ParticlePlayground.ManipulatorObjectC.transform = new PlaygroundTransformC() |
The transform of this manipulator (wrapped class for threading).
MANIPULATORTYPEC ParticlePlayground.ManipulatorObjectC.type |
The type of this manipulator.
OnPlaygroundParticle ParticlePlayground.ManipulatorObjectC.particleEventBirth |
The birth event of a particle (when using Event Listeners).
OnPlaygroundParticle ParticlePlayground.ManipulatorObjectC.particleEventCollision |
The collision event of a particle (when using Event Listeners).
OnPlaygroundParticle ParticlePlayground.ManipulatorObjectC.particleEventDeath |
The death event of a particle (when using Event Listeners).
OnPlaygroundParticle ParticlePlayground.ManipulatorObjectC.particleEventEnter |
The entering event of a particle (when using Event Listeners).
OnPlaygroundParticle ParticlePlayground.ManipulatorObjectC.particleEventExit |
The exit event of a particle (when using Event Listeners).