예제 #1
0
    private void Awake()
    {
        pipes = new Pipe[PipeCount];

        for (int i = 0; i < pipes.Length; i++)
        {
            Pipe pipe = pipes[i] = Instantiate(PipePrefab);
            pipe.transform.SetParent(transform, false);
            pipe.Generate();

            if (i > 0)
            {
                pipe.AlingWith(pipes[i - 1]);
            }
        }
        AlignNextPipeWithrigin();
    }