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

public class BackgroundController : MonoBehaviour
{
    public List<Transform> RoadPieces;

    private void Update()
    {
        foreach (Transform lStreetPiece in RoadPieces)
        {
            lStreetPiece.localPosition = new Vector3(lStreetPiece.localPosition.x - 0.2f, lStreetPiece.localPosition.y, lStreetPiece.localPosition.z);
            if (lStreetPiece.localPosition.x < -533)
                lStreetPiece.localPosition = new Vector3(lStreetPiece.localPosition.x + 72, lStreetPiece.localPosition.y, lStreetPiece.localPosition.z);
        }
    }
}
