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


C# ParticleSystem.IsAlive方法代码示例

本文整理汇总了C#中UnityEngine.ParticleSystem.IsAlive方法的典型用法代码示例。如果您正苦于以下问题:C# ParticleSystem.IsAlive方法的具体用法?C# ParticleSystem.IsAlive怎么用?C# ParticleSystem.IsAlive使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UnityEngine.ParticleSystem的用法示例。


在下文中一共展示了ParticleSystem.IsAlive方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CleanupExplosion

 IEnumerator CleanupExplosion(ParticleSystem explosion)
 {
     while (explosion.IsAlive()) {
         yield return new WaitForEndOfFrame ();
     }
     Destroy (explosion.gameObject);
 }
开发者ID:anderbubble,项目名称:Wombat,代码行数:7,代码来源:Explosion.cs

示例2: AutoReleaseParticle

    public IEnumerator AutoReleaseParticle(string prefabName, ParticleSystem particle, PrefabPoolAgent agent)
    {
        yield return new WaitForSeconds(particle.startDelay + 0.25f);

        GameObject go = particle.gameObject;
        while (particle.IsAlive(true) && go.activeInHierarchy)
        {
            yield return null;
        }

        if (go.activeInHierarchy)
        {
            Despawn(prefabName, agent);
            particle.Clear(true);
        }
    }
开发者ID:meta-42,项目名称:uEasyKit,代码行数:16,代码来源:PrefabPool.cs

示例3: ListenToDespawn

        protected IEnumerator ListenToDespawn(ParticleSystem emitter)
        {
            // Wait for the delay time to complete
            // Waiting the extra frame seems to be more stable and means at least one 
            //  frame will always pass
            yield return new WaitForSeconds(emitter.startDelay + 0.25f);
						
            while (emitter.IsAlive(true))
            {
                if (!emitter.gameObject.activeInHierarchy)
                {
                    emitter.Clear(true);
                    yield break;  // Do nothing, already despawned. Quit.
                }

                yield return null;
            }

            // Turn off emit before despawning
            InstanceManager.Despawn(this.poolName, emitter.transform);
        }
开发者ID:TripleLoopGames,项目名称:space-roaches,代码行数:21,代码来源:SelfDespawn.cs

示例4: Awake

 void Awake()
 {
     PS = GetComponent<ParticleSystem>();
     PS.IsAlive();
 }
开发者ID:Rezan7CC,项目名称:AngryFarmer,代码行数:5,代码来源:AutoDestroyPS.cs

示例5: ListenForEmitDespawn

        private IEnumerator ListenForEmitDespawn(ParticleSystem emitter)
        {
            yield return new WaitForSeconds(emitter.startDelay + 0.25f);

            float safetimer = 0;
            GameObject emitterGO = emitter.gameObject;
            while (emitter.IsAlive(true) && emitterGO.activeInHierarchy)
            {
                safetimer += Time.deltaTime;
                if (safetimer > MaxParticleDespawnTime)
                {
                    Debug.LogWarning
                    (
                          string.Format
                          (
                              "SpawnPool {0}: " +
                                  "Timed out while listening for all particles to die. " +
                                  "Waited for {1}sec.", PoolName, MaxParticleDespawnTime
                          )
                      );
                }
                yield return null;
            }

            if (emitterGO.activeInHierarchy)
            {
                Despawn(emitter.transform);
                emitter.Clear(true);
            }
        }
开发者ID:woshihuo12,项目名称:UnityHello,代码行数:30,代码来源:SimplePoolManager.cs

示例6: Destroy_Particle_System_When_Done

        private IEnumerator Destroy_Particle_System_When_Done( ParticleSystem particle_system )
        {
            while( particle_system.IsAlive() )
            {
                yield return new WaitForSeconds( 1f );
            }

            Object.Destroy( particle_system.gameObject );
        }
开发者ID:spectre1989,项目名称:bitcoin_blockchain_visualiser,代码行数:9,代码来源:Fireworks_Visualiser.cs


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