Exemplo n.º 1
0
 public void Despawn(string prefabName, PrefabPoolAgent agent)
 {
     if (poolDict.ContainsKey(prefabName))
     {
         poolDict[prefabName].Release(agent);
     }
 }
Exemplo n.º 2
0
    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);
        }
    }
Exemplo n.º 3
0
 public void Despawn(string prefabName, PrefabPoolAgent agent)
 {
     if (poolDict.ContainsKey(prefabName))
     {
         poolDict[prefabName].Release(agent);
     }
 }
Exemplo n.º 4
0
    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);
        }
    }