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

public class Cloud : MonoBehaviour
{
	public float OuterBounds = 21.0f;
	public float Speed = 0.5f;

    // Start is called before the first frame update
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
    	float width = transform.GetComponent<Renderer>().bounds.size[0];
    	if (transform.position.x < (-1.0f * OuterBounds - width))
    	{
    		transform.Translate(Vector3.right * (OuterBounds * 2 + width));
    		return;
    	}
    	transform.Translate(Vector3.left * (Speed * Time.deltaTime));
    }
}
