#pragma strict

var upRange : float = 1.0;
var downRange : float = 1.0;
var waveOffset: float = 0.0;

internal var yStartPos: float;
internal var upPos : float;
internal var downPos : float;

var speed : float = 0.2;


function Start () {

	yStartPos = transform.position.y; 

}

function FixedUpdate () {

	upPos = yStartPos +upRange;
	downPos = yStartPos - downRange;
	var weight : float = Mathf.Cos((Time.time + waveOffset) * speed * 2 * Mathf.PI) * 0.5 + 0.5;
	transform.position.y = upPos * weight + downPos * (1-weight);


}