using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class GameManager : MonoBehaviour
{
    [SerializeField] GameObject[] roadPrefab;

    void GenerateNewSegment()
    {
        int randIndex = Random.Range(0, roadPrefab.Length);
        Instantiate(roadPrefab[randIndex],
            new Vector3(2.5f, -1.761234f, 37.7f),
            roadPrefab[randIndex].transform.rotation);
    }

    // Start is called before the first frame update
    void Start()
    {
        InvokeRepeating("GenerateNewSegment", 5.0f, 4.0f);
    }

    // Update is called once per frame
    void Update()
    {
        
    }
}
