本文整理汇总了C#中ParticlePlayground.PlaygroundParticlesC.Emit方法的典型用法代码示例。如果您正苦于以下问题:C# PlaygroundParticlesC.Emit方法的具体用法?C# PlaygroundParticlesC.Emit怎么用?C# PlaygroundParticlesC.Emit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParticlePlayground.PlaygroundParticlesC
的用法示例。
在下文中一共展示了PlaygroundParticlesC.Emit方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Emit
/// <summary>
/// Sets emission on/off.
/// </summary>
/// <param name="playgroundParticles">Playground particles.</param>
/// <param name="setEmission">If set to <c>true</c> set emission.</param>
public static void Emit (PlaygroundParticlesC playgroundParticles, bool setEmission) {
playgroundParticles.Emit(setEmission);
}
示例2: Update
// Updates a PlaygroundParticlesC object (called from Playground)
public static void Update (PlaygroundParticlesC playgroundParticles) {
if (playgroundParticles.isYieldRefreshing || playgroundParticles.isLoading || playgroundParticles.playgroundCache==null) return;
// Emission halt for disabling called from calculation thread
if (playgroundParticles.queueEmissionHalt)
playgroundParticles.particleSystemGameObject.SetActive(false);
// Particle count
if (playgroundParticles.particleCount!=playgroundParticles.previousParticleCount) {
SetParticleCount(playgroundParticles, playgroundParticles.particleCount);
playgroundParticles.Start();
return;
}
// Particle emission
if (playgroundParticles.emit!=playgroundParticles.previousEmission) {
playgroundParticles.Emit (playgroundParticles.emit);
}
// Particle size
if (playgroundParticles.sizeMin!=playgroundParticles.previousSizeMin || playgroundParticles.sizeMax!=playgroundParticles.previousSizeMax)
SetSizeRandom(playgroundParticles, playgroundParticles.sizeMin, playgroundParticles.sizeMax);
// Particle rotation
if (playgroundParticles.initialRotationMin!=playgroundParticles.previousInitialRotationMin || playgroundParticles.initialRotationMax!=playgroundParticles.previousInitialRotationMax)
SetInitialRotationRandom(playgroundParticles, playgroundParticles.initialRotationMin, playgroundParticles.initialRotationMax);
if (playgroundParticles.rotationSpeedMin!=playgroundParticles.previousRotationSpeedMin || playgroundParticles.rotationSpeedMax!=playgroundParticles.previousRotationSpeedMax)
SetRotationRandom(playgroundParticles, playgroundParticles.rotationSpeedMin, playgroundParticles.rotationSpeedMax);
// Particle velocity
if (playgroundParticles.applyInitialVelocity)
if (playgroundParticles.initialVelocityMin!=playgroundParticles.previousVelocityMin || playgroundParticles.initialVelocityMax!=playgroundParticles.previousVelocityMax || playgroundParticles.playgroundCache.initialVelocity==null || playgroundParticles.playgroundCache.initialVelocity.Length!=playgroundParticles.particleCount)
SetVelocityRandom(playgroundParticles, playgroundParticles.initialVelocityMin, playgroundParticles.initialVelocityMax);
// Particle local velocity
if (playgroundParticles.applyInitialLocalVelocity)
if (playgroundParticles.initialLocalVelocityMin!=playgroundParticles.previousLocalVelocityMin || playgroundParticles.initialLocalVelocityMax!=playgroundParticles.previousLocalVelocityMax || playgroundParticles.playgroundCache.initialLocalVelocity==null || playgroundParticles.playgroundCache.initialLocalVelocity.Length!=playgroundParticles.particleCount)
SetLocalVelocityRandom(playgroundParticles, playgroundParticles.initialLocalVelocityMin, playgroundParticles.initialLocalVelocityMax);
// Particle life
if (playgroundParticles.previousLifetime!=playgroundParticles.lifetime) {
SetLifetime(playgroundParticles, playgroundParticles.sorting, playgroundParticles.lifetime);
return;
}
// Particle emission rate
if (playgroundParticles.previousEmissionRate!=playgroundParticles.emissionRate)
SetEmissionRate(playgroundParticles);
// Particle state change
if (playgroundParticles.source==SOURCEC.State && playgroundParticles.activeState!=playgroundParticles.previousActiveState) {
if (playgroundParticles.states[playgroundParticles.activeState].positionLength>playgroundParticles.particleCount)
SetParticleCount(playgroundParticles, playgroundParticles.states[playgroundParticles.activeState].positionLength);
playgroundParticles.previousActiveState = playgroundParticles.activeState;
}
// Particle calculation
if (PlaygroundC.reference.calculate && playgroundParticles.calculate && !playgroundParticles.inTransition)
ThreadedCalculations(playgroundParticles);
else playgroundParticles.cameFromNonCalculatedFrame = true;
// Assign all particles into the particle system
if (!playgroundParticles.inTransition && playgroundParticles.particleCache.Length>0 && playgroundParticles.calculate)
playgroundParticles.shurikenParticleSystem.SetParticles(playgroundParticles.particleCache, playgroundParticles.particleCache.Length);
// Make sure this particle system is playing
if (playgroundParticles.shurikenParticleSystem.isPaused || playgroundParticles.shurikenParticleSystem.isStopped)
playgroundParticles.shurikenParticleSystem.Play();
}