本文整理汇总了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);
}
示例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);
}
}
示例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);
}
示例4: Awake
void Awake()
{
PS = GetComponent<ParticleSystem>();
PS.IsAlive();
}
示例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);
}
}
示例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 );
}