using UnityEngine;
using System.Collections;

public class SizeChange : MonoBehaviour {

	public float speed;
	private float count;
	public float min;
	public float max;

	private Vector3 initialScale;

	// Use this for initialization
	void Start () {
		initialScale = transform.localScale;
		count = Random.Range(0f, 1f / speed);
	}
	
	// Update is called once per frame
	void Update () {
		count += Time.deltaTime;
		float scale = min + (max-min)*(0.5f + 0.5f * Mathf.Sin (2 * Mathf.PI * count * speed));
		transform.localScale = scale * initialScale;
	}
}
