本文整理汇总了C#中ParticlePlayground.PlaygroundParticlesC.SetSourcePosition方法的典型用法代码示例。如果您正苦于以下问题:C# PlaygroundParticlesC.SetSourcePosition方法的具体用法?C# PlaygroundParticlesC.SetSourcePosition怎么用?C# PlaygroundParticlesC.SetSourcePosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParticlePlayground.PlaygroundParticlesC
的用法示例。
在下文中一共展示了PlaygroundParticlesC.SetSourcePosition方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ThreadedCalculations
//.........这里部分代码省略.........
} else {
playgroundParticles.playgroundCache.maskAlpha[maskedP] += (1f/playgroundParticles.particleMaskTime)*playgroundParticles.localDeltaTime;
}
}
} else {
playgroundParticles.playgroundCache.isMasked[p] = false;
playgroundParticles.playgroundCache.maskAlpha[p] = 1f;
}
Color32 lifetimeColor = playgroundParticles.GetParticleColor(p, normalizedLife, normalizedP);
// Assign color to particle
playgroundParticles.particleCache[p].color = lifetimeColor;
// Give Playground Cache its color value
playgroundParticles.playgroundCache.color[p] = lifetimeColor;
// Source positions
if (playgroundParticles.emit) {
if (!playgroundParticles.syncPositionsOnMainThread)
playgroundParticles.playgroundCache.previousTargetPosition[p] = playgroundParticles.playgroundCache.targetPosition[p];
switch (playgroundParticles.source) {
case SOURCEC.State:
if (playgroundParticles.playgroundCache.rebirth[p] || playgroundParticles.onlySourcePositioning || playgroundParticles.onlyLifetimePositioning) {
if (playgroundParticles.applyInitialLocalVelocity && !playgroundParticles.onlyLifetimePositioning)
playgroundParticles.playgroundCache.targetDirection[p] = fMx.MultiplyPoint3x4(Vector3Scale(playgroundParticles.playgroundCache.initialLocalVelocity[p], playgroundParticles.states[playgroundParticles.activeState].GetNormal(p)));
if (playgroundParticles.onlyLifetimePositioning) {
playgroundParticles.playgroundCache.targetDirection[p] = fMx.MultiplyPoint3x4(Vector3Scale(playgroundParticles.lifetimePositioning.Evaluate(normalizedLife*lifetimePositioningTimeScale, playgroundParticles.lifetimePositioningScale), playgroundParticles.states[playgroundParticles.activeState].GetNormal(p)));
if (playgroundParticles.applyLifetimePositioningPositionScale)
playgroundParticles.playgroundCache.targetDirection[p] *= playgroundParticles.lifetimePositioningPositionScale.Evaluate(normalizedLife);
}
playgroundParticles.SetSourcePosition(p);
// Local space compensation calculation
if (playgroundParticles.localSpace && playgroundParticles.applyLocalSpaceMovementCompensation)
playgroundParticles.playgroundCache.localSpaceMovementCompensation[p] = playgroundParticles.playgroundCache.targetPosition[p]-playgroundParticles.playgroundCache.previousTargetPosition[p];
}
break;
case SOURCEC.Transform:
if (playgroundParticles.playgroundCache.rebirth[p] || playgroundParticles.onlySourcePositioning || playgroundParticles.onlyLifetimePositioning) {
if (playgroundParticles.applyInitialLocalVelocity && !playgroundParticles.onlyLifetimePositioning)
if (playgroundParticles.localSpace && playgroundParticles.transformIndex!=playgroundParticles.psTransformNum)
playgroundParticles.playgroundCache.targetDirection[p] = playgroundParticles.particleSystemInverseRotation*playgroundParticles.sourceTransforms[playgroundParticles.transformIndex].rotation*playgroundParticles.playgroundCache.initialLocalVelocity[p];
else
playgroundParticles.playgroundCache.targetDirection[p] = playgroundParticles.sourceTransforms[playgroundParticles.transformIndex].rotation*playgroundParticles.playgroundCache.initialLocalVelocity[p];
if (playgroundParticles.onlyLifetimePositioning) {
playgroundParticles.playgroundCache.targetDirection[p] = playgroundParticles.sourceTransforms[playgroundParticles.transformIndex].rotation*playgroundParticles.lifetimePositioning.Evaluate(normalizedLife*lifetimePositioningTimeScale, playgroundParticles.lifetimePositioningScale);
if (playgroundParticles.applyLifetimePositioningPositionScale)
playgroundParticles.playgroundCache.targetDirection[p] *= playgroundParticles.lifetimePositioningPositionScale.Evaluate(normalizedLife*lifetimePositioningTimeScale);
}
playgroundParticles.SetSourcePosition(p);
// Local space compensation calculation
if (playgroundParticles.localSpace && playgroundParticles.applyLocalSpaceMovementCompensation)
playgroundParticles.playgroundCache.localSpaceMovementCompensation[p] = playgroundParticles.playgroundCache.targetPosition[p]-playgroundParticles.playgroundCache.previousTargetPosition[p];
}
break;
case SOURCEC.WorldObject:
if (playgroundParticles.playgroundCache.rebirth[p] || playgroundParticles.onlySourcePositioning || playgroundParticles.onlyLifetimePositioning) {
if (playgroundParticles.applyInitialLocalVelocity && !playgroundParticles.onlyLifetimePositioning)
playgroundParticles.playgroundCache.targetDirection[p] = fMx.MultiplyPoint3x4(Vector3Scale(playgroundParticles.playgroundCache.initialLocalVelocity[p], playgroundParticles.worldObject.normals[p%playgroundParticles.worldObject.normals.Length]));
if (playgroundParticles.onlyLifetimePositioning) {