当前位置: 首页>>代码示例>>C#>>正文


C# PlaygroundParticlesC.Emit方法代码示例

本文整理汇总了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);
		}
开发者ID:nermakov777,项目名称:Unity_Tests,代码行数:8,代码来源:PlaygroundC.cs

示例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();
		}
开发者ID:Raj2509,项目名称:net.kibotu.sandbox.unity.dragnslay,代码行数:70,代码来源:PlaygroundParticlesC.cs


注:本文中的ParticlePlayground.PlaygroundParticlesC.Emit方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。