using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using DG.Tweening;

public class StripeFlickerer : MonoBehaviour 
{
	public float interval = 0.1f;
	public float positionRange = 1f;
	public float scaleRange = 1f;

	private float countdown;
	private Vector3 originalPosition;
	private Vector3 originalScale;

	private void Awake()
	{
		countdown = interval;
		originalPosition = transform.position;
		originalScale = transform.localScale;
	}

	private void Update()
	{
		countdown -= Time.deltaTime;
		if (countdown <= 0f)
		{
			transform.position = originalPosition + Vector3.right * Random.Range(-positionRange, positionRange);
			transform.localScale = originalScale + Vector3.right * Random.Range(-scaleRange, scaleRange);
			countdown = interval;
		}
	}
}
