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

public class DecorDinoScript : MonoBehaviour
{
    public RectTransform dino;
    public float direction;

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

    // Update is called once per frame
    void Update()
    {
        dino.localPosition += direction * Vector3.right * Time.deltaTime * 100f;
        dino.localScale = new Vector3(direction, 1, 1);
        if(dino.localPosition.x < -500 && direction == -1f)
        {
            direction = 1f;
        }
        else if(dino.localPosition.x > 1000 && direction == 1f)
        {
            direction = -1f;
        }
    }
}
