Пример #1
0
 private void OnTriggerExit(Collider collider)
 {
     if (collider.gameObject.CompareTag("Player"))
     {
         pipePool.ReturnToPool(this);
     }
 }
Пример #2
0
    /// <summary>
    /// Destroy all pipes and stop spawning pipes.
    /// </summary>
    public void DestroyAllPipes()
    {
        canSpawn = false;

        for (int i = pipes.Count - 1; i >= 0; i--)
        {
            Pipe pipe = pipes[i];
            pipes.RemoveAt(i);
            pipePool.ReturnToPool(pipe);
        }
    }