ReleaseInstance() public method

public ReleaseInstance ( Transform instance ) : void
instance Transform
return void
 void DeathTrigger()                 // Activated by Death Triggers, also called on Reset and LevelComplete
 {
     // spawn a death particle
     deathParticlePool.GetInstance(thisTransform.position);
     thisTransform.rotation = Quaternion.identity;                                   // Reset rotation, velocity, etc
     rb2D.velocity          = Vector2.zero;
     rb2D.angularVelocity   = 0f;
     ChangeDirections(1);                                                                                    // Make sure chip is facing forwards
     // Disable this gameObject
     chipPool.ReleaseInstance(thisTransform);
 }
Beispiel #2
0
 void Update()
 {
     if (!particleSystem.IsAlive(true) && particleSystem.renderer.enabled)
     {
         _pool.ReleaseInstance(transform);
     }
 }
 void Update()
 {
     if (!GetComponent <ParticleSystem>().IsAlive(true) && GetComponent <Renderer>().enabled)
     {
         _pool.ReleaseInstance(transform);
     }
 }
Beispiel #4
0
    void Update()
    {
        List <Transform> toDelete = new List <Transform>();

        foreach (var effect in currentlyPlayingParticles)
        {
            if (!effect.GetComponentInChildren <ParticleSystem>().IsAlive(true))
            {
                toDelete.Add(effect);
                _pool.ReleaseInstance(effect);
            }
        }
        foreach (var effectToDelete in toDelete)
        {
            currentlyPlayingParticles.Remove(effectToDelete);
        }
    }