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

public class ParallaxController : MonoBehaviour
{
    public float speed;

    [SerializeField]
    Renderer bgRenderer;

    void Update()
    {
        if (Input.GetKey(KeyCode.Space))
        {
            bgRenderer.material.mainTextureOffset+=new Vector2(speed*Time.deltaTime,0);
        }
        else
        {
            bgRenderer.material.mainTextureOffset-=new Vector2(speed*Time.deltaTime,0);
        }
        
    }
    
}