using UnityEngine;
using System.Collections;

public class BounceUpAndDown : MonoBehaviour {
	public float fFrequencyBounce = 4, fCurrentTime,fStrength = 0.1f;
	bool bUp = false;
	// Use this for initialization
	void Start () {
		fCurrentTime = (1/fFrequencyBounce)/3;
	}
	
	// Update is called once per frame
	void Update () {
		if(fCurrentTime < 0)
		{
			bUp = !bUp;
			fCurrentTime = 1/fFrequencyBounce;
		}
		fCurrentTime-=Time.deltaTime;
		if (bUp)
		{
			transform.localScale += new Vector3(0,fStrength*Time.deltaTime,0);
		}else
		{
			transform.localScale -= new Vector3(0,fStrength*Time.deltaTime,0);
		}
	}
}
