Example #1
0
 private void Awake()
 {
     pipes = new Pipe[pipeCount];
     for (int i = 0; i < pipes.Length; i++)
     {
         Pipe pipe = pipes[i] = Instantiate <Pipe>(pipePrefab);
         pipe.transform.SetParent(transform, false);
         pipe.Generate();
         if (i > 0)
         {
             pipe.AlignedWith(pipes [i - 1]);
         }
     }
     AlignNextPipeWithOrigin();
 }