using UnityEngine;

/// <summary>
/// Move each layer
/// Original script: https://pastebin.com/ZniykeGz.
/// YouTube link: https://youtu.be/MEy-kIGE-lI.
/// </summary>

public class ParallaxLayer : MonoBehaviour
{
    public float parallaxFactor;

    public void Move(float delta)
    {
        Vector3 newPos = transform.localPosition;
        newPos.x -= delta * parallaxFactor;

        transform.localPosition = newPos;
    }
}