本文整理汇总了C#中ParticlePlayground.PlaygroundParticlesC.UpdateEventParticle方法的典型用法代码示例。如果您正苦于以下问题:C# PlaygroundParticlesC.UpdateEventParticle方法的具体用法?C# PlaygroundParticlesC.UpdateEventParticle怎么用?C# PlaygroundParticlesC.UpdateEventParticle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParticlePlayground.PlaygroundParticlesC
的用法示例。
在下文中一共展示了PlaygroundParticlesC.UpdateEventParticle方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetManipulatorParticles
/// <summary>
/// Returns all current particles within a local manipulator (in form of an Event Particle, however no event will be needed).
/// </summary>
/// <returns>The manipulator particles.</returns>
/// <param name="manipulator">Manipulator.</param>
/// <param name="playgroundParticles">Playground particles.</param>
public static List<PlaygroundEventParticle> GetManipulatorParticles (int manipulator, PlaygroundParticlesC playgroundParticles) {
if (manipulator<0 || manipulator>=playgroundParticles.manipulators.Count) return null;
List<PlaygroundEventParticle> particles = new List<PlaygroundEventParticle>();
PlaygroundEventParticle particle = new PlaygroundEventParticle();
for (int i = 0; i<playgroundParticles.particleCount; i++) {
if (playgroundParticles.manipulators[manipulator].Contains(playgroundParticles.playgroundCache.position[i], playgroundParticles.manipulators[manipulator].transform.position)) {
playgroundParticles.UpdateEventParticle(particle, i);
particles.Add (particle.Clone());
}
}
return particles;
}
示例2: SendDeathEvents
/// <summary>
/// Sends the death events.
/// </summary>
/// <param name="playgroundParticles">Playground particles.</param>
/// <param name="p">Particle index.</param>
public static void SendDeathEvents(PlaygroundParticlesC playgroundParticles, int p)
{
if ((playgroundParticles.playgroundCache.life[p]>0||playgroundParticles.playgroundCache.changedByPropertyDeath[p]) && !playgroundParticles.playgroundCache.isNonBirthed[p]) {
if (playgroundParticles.loop || (!playgroundParticles.loop && playgroundParticles.playgroundCache.isFirstLoop[p])) {
playgroundParticles.SendEvent(EVENTTYPEC.Death, p);
}
}
if (playgroundParticles.hasEventManipulatorLocal) {
for (int i = 0; i<playgroundParticles.manipulators.Count; i++) {
if (playgroundParticles.manipulators[i].trackParticles &&
playgroundParticles.manipulators[i].RemoveParticle (playgroundParticles.particleSystemId, p)) {
if (playgroundParticles.manipulators[i].sendEventDeath) {
playgroundParticles.UpdateEventParticle(playgroundParticles.manipulators[i].manipulatorEventParticle, p);
playgroundParticles.manipulators[i].SendParticleEventDeath();
}
}
}
}
if (playgroundParticles.hasEventManipulatorGlobal) {
for (int i = 0; i<PlaygroundC.reference.manipulators.Count; i++) {
if (PlaygroundC.reference.manipulators[i].trackParticles &&
PlaygroundC.reference.manipulators[i].RemoveParticle (playgroundParticles.particleSystemId, p)) {
if (PlaygroundC.reference.manipulators[i].sendEventDeath) {
playgroundParticles.UpdateEventParticle(PlaygroundC.reference.manipulators[i].manipulatorEventParticle, p);
PlaygroundC.reference.manipulators[i].SendParticleEventDeath();
}
}
}
}
playgroundParticles.playgroundCache.isNonBirthed[p] = true;
}
示例3: Rebirth
//.........这里部分代码省略.........
} else {
if (!playgroundParticles.applyLifetimePositioningPositionScale) {
playgroundParticles.playgroundCache.position[p] =
playgroundParticles.playgroundCache.targetPosition[p]+
playgroundParticles.lifetimePositioning.Evaluate(0, playgroundParticles.lifetimePositioningScale);
} else {
playgroundParticles.playgroundCache.position[p] =
playgroundParticles.playgroundCache.targetPosition[p]+
playgroundParticles.lifetimePositioning.Evaluate(0, playgroundParticles.lifetimePositioningScale)*
playgroundParticles.lifetimePositioningPositionScale.Evaluate(0);
}
}
if (!playgroundParticles.syncPositionsOnMainThread)
playgroundParticles.particleCache[p].position = playgroundParticles.playgroundCache.targetPosition[p];
playgroundParticles.playgroundCache.previousParticlePosition[p] = playgroundParticles.playgroundCache.targetPosition[p];
playgroundParticles.playgroundCache.collisionParticlePosition[p] = playgroundParticles.playgroundCache.targetPosition[p];
}
if (playgroundParticles.applyInitialColorOnRebirth) {
playgroundParticles.particleCache[p].color = playgroundParticles.playgroundCache.initialColor[p];
playgroundParticles.playgroundCache.color[p] = playgroundParticles.playgroundCache.initialColor[p];
}
} else {
playgroundParticles.particleCache[p].position = PlaygroundC.initialTargetPosition;
}
// Set new random rotation
if (playgroundParticles.applyRandomRotationOnRebirth && !playgroundParticles.rotateTowardsDirection)
playgroundParticles.playgroundCache.initialRotation[p] = RandomRange(random, playgroundParticles.initialRotationMin, playgroundParticles.initialRotationMax);
if (!playgroundParticles.rotateTowardsDirection)
playgroundParticles.playgroundCache.rotation[p] = playgroundParticles.playgroundCache.initialRotation[p];
else {
Vector3 particleDir;
if (!playgroundParticles.onlySourcePositioning&&playgroundParticles.onlyLifetimePositioning)
particleDir = (playgroundParticles.playgroundCache.position[p]+playgroundParticles.lifetimePositioning.Evaluate(.01f, playgroundParticles.lifetimePositioningScale))-playgroundParticles.playgroundCache.position[p];
else
particleDir = playgroundParticles.playgroundCache.velocity[p];
playgroundParticles.playgroundCache.rotation[p] = playgroundParticles.playgroundCache.initialRotation[p]+SignedAngle(
Vector3.up,
particleDir,
playgroundParticles.rotationNormal
);
}
if (!playgroundParticles.syncPositionsOnMainThread)
playgroundParticles.particleCache[p].rotation = playgroundParticles.playgroundCache.rotation[p];
// Set size
if (playgroundParticles.applyLifetimeSize && !playgroundParticles.applyParticleArraySize)
playgroundParticles.playgroundCache.size[p] = playgroundParticles.playgroundCache.initialSize[p]*playgroundParticles.lifetimeSize.Evaluate(0)*playgroundParticles.scale;
else if (playgroundParticles.applyLifetimeSize && playgroundParticles.applyParticleArraySize)
playgroundParticles.playgroundCache.size[p] = playgroundParticles.playgroundCache.initialSize[p]*playgroundParticles.lifetimeSize.Evaluate(0)*playgroundParticles.particleArraySize.Evaluate((p*1f)/(playgroundParticles.particleCount*1f))*playgroundParticles.scale;
else if (playgroundParticles.applyParticleArraySize)
playgroundParticles.playgroundCache.size[p] = playgroundParticles.playgroundCache.initialSize[p]*playgroundParticles.particleArraySize.Evaluate((p*1f)/(playgroundParticles.particleCount*1f))*playgroundParticles.scale;
else playgroundParticles.playgroundCache.size[p] = playgroundParticles.playgroundCache.initialSize[p]*playgroundParticles.scale;
if (!playgroundParticles.syncPositionsOnMainThread)
playgroundParticles.particleCache[p].size = playgroundParticles.playgroundCache.maskAlpha[p]>0?playgroundParticles.playgroundCache.size[p]:0;
// Set color gradient id
if (playgroundParticles.colorSource==COLORSOURCEC.LifetimeColors && playgroundParticles.lifetimeColors.Count>0) {
playgroundParticles.lifetimeColorId++;playgroundParticles.lifetimeColorId=playgroundParticles.lifetimeColorId%playgroundParticles.lifetimeColors.Count;
playgroundParticles.playgroundCache.lifetimeColorId[p] = playgroundParticles.lifetimeColorId;
}
// Local Manipulators
if (playgroundParticles.calculateManipulatorOnRebirth) {
for (int m = 0; m<playgroundParticles.manipulators.Count; m++) {
if (playgroundParticles.manipulators[m].transform!=null) {
CalculateManipulator(playgroundParticles, playgroundParticles.manipulators[m], p, playgroundParticles.t, playgroundParticles.playgroundCache.life[p], playgroundParticles.playgroundCache.position[p], (playgroundParticles.localSpace?playgroundParticles.manipulators[m].transform.localPosition:playgroundParticles.manipulators[m].transform.position)+playgroundParticles.manipulatorFix, playgroundParticles.localSpace);
}
}
}
// Send birth event
if (playgroundParticles.events.Count>0 && playgroundParticles.playgroundCache.rebirth[p])
playgroundParticles.SendEvent(EVENTTYPEC.Birth, p);
if (playgroundParticles.hasEventManipulatorLocal) {
for (int i = 0; i<playgroundParticles.manipulators.Count; i++) {
if (playgroundParticles.manipulators[i].trackParticles &&
playgroundParticles.manipulators[i].sendEventBirth &&
playgroundParticles.manipulators[i].Contains (playgroundParticles.playgroundCache.targetPosition[p], playgroundParticles.manipulators[i].transform.position)) {
playgroundParticles.UpdateEventParticle(playgroundParticles.manipulators[i].manipulatorEventParticle, p);
playgroundParticles.manipulators[i].SendParticleEventBirth();
}
}
}
if (playgroundParticles.hasEventManipulatorGlobal) {
for (int i = 0; i<PlaygroundC.reference.manipulators.Count; i++) {
if (PlaygroundC.reference.manipulators[i].trackParticles &&
PlaygroundC.reference.manipulators[i].sendEventBirth &&
PlaygroundC.reference.manipulators[i].Contains (playgroundParticles.playgroundCache.targetPosition[p], PlaygroundC.reference.manipulators[i].transform.position)) {
playgroundParticles.UpdateEventParticle(PlaygroundC.reference.manipulators[i].manipulatorEventParticle, p);
PlaygroundC.reference.manipulators[i].SendParticleEventBirth();
}
}
}
}
示例4: Collisions
//.........这里部分代码省略.........
if (hasCollisionExclusion) {
if (playgroundParticles.collisionExclusion.Contains(hitInfo.transform))
continue;
}
// Set particle to location
playgroundParticles.playgroundCache.position[p] = playgroundParticles.playgroundCache.collisionParticlePosition[p];
// Store velocity before collision
preCollisionVelocity = playgroundParticles.playgroundCache.velocity[p];
// Reflect particle
playgroundParticles.playgroundCache.velocity[p] = Vector3.Reflect(playgroundParticles.playgroundCache.velocity[p], hitInfo.normal+RandomVector3(playgroundParticles.internalRandom01, playgroundParticles.bounceRandomMin, playgroundParticles.bounceRandomMax))*playgroundParticles.bounciness;
// Apply lifetime loss
if (playgroundParticles.lifetimeLoss>0) {
playgroundParticles.playgroundCache.birth[p] -= playgroundParticles.playgroundCache.life[p]/(1f-playgroundParticles.lifetimeLoss);
playgroundParticles.playgroundCache.changedByPropertyDeath[p] = true;
}
// Add force to rigidbody
if (playgroundParticles.affectRigidbodies && hitInfo.rigidbody)
hitInfo.rigidbody.AddForceAtPosition((playgroundParticles.inverseRigidbodyCollision?-preCollisionVelocity:preCollisionVelocity)*playgroundParticles.mass, playgroundParticles.playgroundCache.position[p]);
// Send event
if (hasEvents)
playgroundParticles.SendEvent(EVENTTYPEC.Collision, p, preCollisionVelocity, hitInfo.transform, hitInfo.collider);
if (playgroundParticles.hasEventManipulatorLocal) {
for (int i = 0; i<playgroundParticles.manipulators.Count; i++) {
if (playgroundParticles.manipulators[i].trackParticles &&
playgroundParticles.manipulators[i].sendEventCollision &&
playgroundParticles.manipulators[i].Contains (playgroundParticles.playgroundCache.position[p], playgroundParticles.manipulators[i].transform.position)) {
playgroundParticles.UpdateEventParticle(playgroundParticles.manipulators[i].manipulatorEventParticle, p);
playgroundParticles.manipulators[i].manipulatorEventParticle.collisionCollider = hitInfo.collider;
playgroundParticles.manipulators[i].manipulatorEventParticle.collisionParticlePosition = hitInfo.point;
playgroundParticles.manipulators[i].manipulatorEventParticle.collisionTransform = hitInfo.transform;
playgroundParticles.manipulators[i].SendParticleEventCollision();
}
}
}
if (playgroundParticles.hasEventManipulatorGlobal) {
for (int i = 0; i<PlaygroundC.reference.manipulators.Count; i++) {
if (PlaygroundC.reference.manipulators[i].trackParticles &&
PlaygroundC.reference.manipulators[i].sendEventCollision &&
PlaygroundC.reference.manipulators[i].Contains (playgroundParticles.playgroundCache.position[p], PlaygroundC.reference.manipulators[i].transform.position)) {
playgroundParticles.UpdateEventParticle(PlaygroundC.reference.manipulators[i].manipulatorEventParticle, p);
playgroundParticles.manipulators[i].manipulatorEventParticle.collisionCollider = hitInfo.collider;
playgroundParticles.manipulators[i].manipulatorEventParticle.collisionParticlePosition = hitInfo.point;
playgroundParticles.manipulators[i].manipulatorEventParticle.collisionTransform = hitInfo.transform;
PlaygroundC.reference.manipulators[i].SendParticleEventCollision();
}
}
}
}
} else {
hitInfo2D = Physics2D.Raycast(
playgroundParticles.playgroundCache.collisionParticlePosition[p],
(playgroundParticles.playgroundCache.position[p]-playgroundParticles.playgroundCache.collisionParticlePosition[p]).normalized,
(Vector3.SqrMagnitude(playgroundParticles.playgroundCache.position[p]-playgroundParticles.playgroundCache.collisionParticlePosition[p])+playgroundParticles.collisionRadius)*2f,
playgroundParticles.collisionMask,
playgroundParticles.minCollisionDepth,
playgroundParticles.maxCollisionDepth
);
if (hitInfo2D.collider!=null) {
示例5: CalculateManipulator
/// <summary>
/// Calculates the effect from a Manipulator.
/// </summary>
/// <param name="playgroundParticles">Playground particles.</param>
/// <param name="thisManipulator">This manipulator.</param>
/// <param name="p">Particle index.</param>
/// <param name="t">Delta time.</param>
/// <param name="life">Lifetime.</param>
/// <param name="particlePosition">Particle position.</param>
/// <param name="manipulatorPosition">Manipulator position.</param>
/// <param name="manipulatorDistance">Manipulator distance.</param>
/// <param name="localSpace">Is calculation in local space?</param>
public static void CalculateManipulator(PlaygroundParticlesC playgroundParticles, ManipulatorObjectC thisManipulator, int p, float t, float life, Vector3 particlePosition, Vector3 manipulatorPosition, bool localSpace)
{
if (thisManipulator.enabled && thisManipulator.transform.available && thisManipulator.strength!=0 && thisManipulator.LifetimeFilter(life, playgroundParticles.lifetime) && thisManipulator.ParticleFilter (p, playgroundParticles.particleCount)) {
bool contains = thisManipulator.Contains(localSpace?(playgroundParticles.particleSystemRotation*particlePosition):particlePosition, localSpace?(playgroundParticles.particleSystemRotation*manipulatorPosition):manipulatorPosition);
// Is this a particle which shouldn't be affected by this manipulator?
if (contains && (playgroundParticles.playgroundCache.excludeFromManipulatorId[p]==thisManipulator.manipulatorId || thisManipulator.nonAffectedParticles.Count>0 && thisManipulator.ContainsNonAffectedParticle(playgroundParticles.particleSystemId, p))) {
return;
}
// Manipulator events
if (thisManipulator.trackParticles) {
// Particle entering
if (contains) {
if ((thisManipulator.trackingMethod==TrackingMethod.ManipulatorId && !thisManipulator.IsSameId(playgroundParticles.playgroundCache.manipulatorId[p])) || (thisManipulator.trackingMethod==TrackingMethod.ParticleId && !thisManipulator.ContainsParticle(playgroundParticles.particleSystemId, p))) {
playgroundParticles.playgroundCache.manipulatorId[p] = thisManipulator.manipulatorId;
thisManipulator.AddParticle(playgroundParticles.particleSystemId, p);
if (thisManipulator.sendEventEnter) {
playgroundParticles.UpdateEventParticle(thisManipulator.manipulatorEventParticle, p);
thisManipulator.SendParticleEventEnter();
}
}
} else {
// Particle exiting
if ((thisManipulator.trackingMethod==TrackingMethod.ManipulatorId && thisManipulator.IsSameId(playgroundParticles.playgroundCache.manipulatorId[p])) || (thisManipulator.trackingMethod==TrackingMethod.ParticleId && thisManipulator.ContainsParticle(playgroundParticles.particleSystemId, p))) {
playgroundParticles.playgroundCache.manipulatorId[p] = 0;
thisManipulator.RemoveParticle(playgroundParticles.particleSystemId, p);
if (thisManipulator.sendEventExit) {
playgroundParticles.UpdateEventParticle(thisManipulator.manipulatorEventParticle, p);
thisManipulator.SendParticleEventExit();
}
}
}
}
float manipulatorDistance = 0;
if (!playgroundParticles.onlySourcePositioning && !playgroundParticles.playgroundCache.noForce[p]) {
// Attractors
if (thisManipulator.type==MANIPULATORTYPEC.Attractor) {
if (contains) {
manipulatorDistance = thisManipulator.strengthDistanceEffect>0?Vector3.Distance (manipulatorPosition, playgroundParticles.playgroundCache.position[p])/thisManipulator.strengthDistanceEffect:10f;
playgroundParticles.playgroundCache.velocity[p] = Vector3.Lerp(playgroundParticles.playgroundCache.velocity[p], (manipulatorPosition-particlePosition)*(thisManipulator.strength/manipulatorDistance), t*(thisManipulator.strength/manipulatorDistance)/thisManipulator.strengthSmoothing);
}
} else
// Attractors Gravitational
if (thisManipulator.type==MANIPULATORTYPEC.AttractorGravitational) {
if (contains) {
manipulatorDistance = thisManipulator.strengthDistanceEffect>0?Vector3.Distance (manipulatorPosition, playgroundParticles.playgroundCache.position[p])/thisManipulator.strengthDistanceEffect:10f;
playgroundParticles.playgroundCache.velocity[p] = Vector3.Lerp(playgroundParticles.playgroundCache.velocity[p], (manipulatorPosition-particlePosition)*thisManipulator.strength/manipulatorDistance, t/thisManipulator.strengthSmoothing);
}
} else
// Repellents
if (thisManipulator.type==MANIPULATORTYPEC.Repellent) {
if (contains) {
manipulatorDistance = thisManipulator.strengthDistanceEffect>0?Vector3.Distance (manipulatorPosition, playgroundParticles.playgroundCache.position[p])/thisManipulator.strengthDistanceEffect:10f;
playgroundParticles.playgroundCache.velocity[p] = Vector3.Lerp(playgroundParticles.playgroundCache.velocity[p], (particlePosition-manipulatorPosition)*(thisManipulator.strength/manipulatorDistance), t*(thisManipulator.strength/manipulatorDistance)/thisManipulator.strengthSmoothing);
}
} else
// Vortex
if (thisManipulator.type==MANIPULATORTYPEC.Vortex) {
if (contains) {
manipulatorDistance = thisManipulator.strengthDistanceEffect>0?Vector3.Distance (manipulatorPosition, playgroundParticles.playgroundCache.position[p])/thisManipulator.strengthDistanceEffect:10f;
playgroundParticles.playgroundCache.velocity[p] = Vector3.Lerp(playgroundParticles.playgroundCache.velocity[p], ((manipulatorPosition-particlePosition)*thisManipulator.strength/manipulatorDistance)-Vector3.Cross(thisManipulator.transform.up, (manipulatorPosition-particlePosition))*thisManipulator.strength/manipulatorDistance, (t*thisManipulator.strength/manipulatorDistance)/thisManipulator.strengthSmoothing);
}
}
}
// Properties
if (thisManipulator.type==MANIPULATORTYPEC.Property) {
manipulatorDistance = thisManipulator.strengthDistanceEffect>0?Vector3.SqrMagnitude (manipulatorPosition - particlePosition)/thisManipulator.strengthDistanceEffect:10f;
PropertyManipulator(playgroundParticles, thisManipulator, thisManipulator.property, p, t, particlePosition, manipulatorPosition, manipulatorDistance, localSpace, contains);
} else
// Combined
if (thisManipulator.type==MANIPULATORTYPEC.Combined) {
manipulatorDistance = thisManipulator.strengthDistanceEffect>0?Vector3.SqrMagnitude (manipulatorPosition - particlePosition)/thisManipulator.strengthDistanceEffect:10f;
for (int i = 0; i<thisManipulator.properties.Count; i++)
PropertyManipulator(playgroundParticles, thisManipulator, thisManipulator.properties[i], p, t, particlePosition, manipulatorPosition, manipulatorDistance, localSpace, contains);
}
}
}
示例6: Rebirth
//.........这里部分代码省略.........
if (playgroundParticles.playgroundCache.scatterPosition[p]==Vector3.zero || playgroundParticles.applyRandomScatterOnRebirth)
playgroundParticles.playgroundCache.scatterPosition[p] = RandomRange(random, playgroundParticles.sourceScatterMin, playgroundParticles.sourceScatterMax);
} else playgroundParticles.playgroundCache.scatterPosition[p] = Vector3.zero;
if (!playgroundParticles.onlyLifetimePositioning) {
playgroundParticles.playgroundCache.position[p] = playgroundParticles.playgroundCache.targetPosition[p];
playgroundParticles.particleCache[p].position = playgroundParticles.playgroundCache.targetPosition[p];
playgroundParticles.playgroundCache.previousParticlePosition[p] = playgroundParticles.playgroundCache.targetPosition[p];
playgroundParticles.playgroundCache.collisionParticlePosition[p] = playgroundParticles.playgroundCache.targetPosition[p];
} else if (!playgroundParticles.onlySourcePositioning) {
Vector3 evalLifetimePosition = playgroundParticles.lifetimePositioning.Evaluate(0f, playgroundParticles.lifetimePositioningScale);
if (playgroundParticles.lifetimePositioningUsesSourceDirection)
evalLifetimePosition = playgroundParticles.playgroundCache.targetDirection[p];
playgroundParticles.playgroundCache.position[p] = playgroundParticles.playgroundCache.targetPosition[p]+evalLifetimePosition;
playgroundParticles.particleCache[p].position = playgroundParticles.playgroundCache.targetPosition[p]+evalLifetimePosition;
playgroundParticles.playgroundCache.previousParticlePosition[p] = playgroundParticles.playgroundCache.targetPosition[p]+evalLifetimePosition;
playgroundParticles.playgroundCache.collisionParticlePosition[p] = playgroundParticles.playgroundCache.targetPosition[p]+evalLifetimePosition;
}
if (playgroundParticles.applyInitialColorOnRebirth) {
playgroundParticles.particleCache[p].color = playgroundParticles.playgroundCache.initialColor[p];
playgroundParticles.playgroundCache.color[p] = playgroundParticles.playgroundCache.initialColor[p];
}
} else {
playgroundParticles.particleCache[p].position = PlaygroundC.initialTargetPosition;
}
// Set new random rotation
if (playgroundParticles.applyRandomRotationOnRebirth && !playgroundParticles.rotateTowardsDirection)
playgroundParticles.playgroundCache.initialRotation[p] = RandomRange(random, playgroundParticles.initialRotationMin, playgroundParticles.initialRotationMax);
if (!playgroundParticles.rotateTowardsDirection)
playgroundParticles.playgroundCache.rotation[p] = playgroundParticles.playgroundCache.initialRotation[p];
else {
Vector3 particleDir;
if (!playgroundParticles.onlySourcePositioning&&playgroundParticles.onlyLifetimePositioning)
particleDir = (playgroundParticles.playgroundCache.position[p]+playgroundParticles.lifetimePositioning.Evaluate(.01f, playgroundParticles.lifetimePositioningScale))-playgroundParticles.playgroundCache.position[p];
else
particleDir = playgroundParticles.playgroundCache.velocity[p];
playgroundParticles.playgroundCache.rotation[p] = playgroundParticles.playgroundCache.initialRotation[p]+SignedAngle(
Vector3.up,
particleDir,
playgroundParticles.rotationNormal
);
}
playgroundParticles.particleCache[p].rotation = playgroundParticles.playgroundCache.rotation[p];
// Set size
if (playgroundParticles.applyLifetimeSize) {
//playgroundParticles.playgroundCache.size[p] = playgroundParticles.playgroundCache.initialSize[p]*playgroundParticles.lifetimeSize.Evaluate(0f)*playgroundParticles.scale;
} else
playgroundParticles.playgroundCache.size[p] = playgroundParticles.playgroundCache.initialSize[p]*playgroundParticles.scale;
playgroundParticles.particleCache[p].size = p>=playgroundParticles.particleMask?playgroundParticles.playgroundCache.size[p]:0;
// Set color gradient id
if (playgroundParticles.colorSource==COLORSOURCEC.LifetimeColors && playgroundParticles.lifetimeColors.Count>0) {
playgroundParticles.lifetimeColorId++;playgroundParticles.lifetimeColorId=playgroundParticles.lifetimeColorId%playgroundParticles.lifetimeColors.Count;
playgroundParticles.playgroundCache.lifetimeColorId[p] = playgroundParticles.lifetimeColorId;
}
// Reset manipulators influence
playgroundParticles.playgroundCache.changedByProperty[p] = false;
playgroundParticles.playgroundCache.changedByPropertyColor[p] = false;
playgroundParticles.playgroundCache.changedByPropertyColorLerp[p] = false;
playgroundParticles.playgroundCache.changedByPropertyColorKeepAlpha[p] = false;
playgroundParticles.playgroundCache.changedByPropertySize[p] = false;
playgroundParticles.playgroundCache.changedByPropertyTarget[p] = false;
playgroundParticles.playgroundCache.changedByPropertyDeath[p] = false;
playgroundParticles.playgroundCache.propertyTarget[p] = 0;
playgroundParticles.playgroundCache.propertyId[p] = 0;
playgroundParticles.playgroundCache.propertyColorId[p] = 0;
playgroundParticles.playgroundCache.manipulatorId[p] = 0;
// Send birth event
if (playgroundParticles.events.Count>0 && playgroundParticles.playgroundCache.rebirth[p])
playgroundParticles.SendEvent(EVENTTYPEC.Birth, p);
if (playgroundParticles.hasEventManipulatorLocal) {
for (int i = 0; i<playgroundParticles.manipulators.Count; i++) {
if (playgroundParticles.manipulators[i].trackParticles &&
playgroundParticles.manipulators[i].sendEventBirth &&
playgroundParticles.manipulators[i].Contains (playgroundParticles.playgroundCache.targetPosition[p], playgroundParticles.manipulators[i].transform.position)) {
playgroundParticles.UpdateEventParticle(playgroundParticles.manipulators[i].manipulatorEventParticle, p);
playgroundParticles.manipulators[i].SendParticleEventBirth();
}
}
}
if (playgroundParticles.hasEventManipulatorGlobal) {
for (int i = 0; i<PlaygroundC.reference.manipulators.Count; i++) {
if (PlaygroundC.reference.manipulators[i].trackParticles &&
PlaygroundC.reference.manipulators[i].sendEventBirth &&
PlaygroundC.reference.manipulators[i].Contains (playgroundParticles.playgroundCache.targetPosition[p], PlaygroundC.reference.manipulators[i].transform.position)) {
playgroundParticles.UpdateEventParticle(PlaygroundC.reference.manipulators[i].manipulatorEventParticle, p);
PlaygroundC.reference.manipulators[i].SendParticleEventBirth();
}
}
}
}