private var addHeight = false;
private var minusHeight = false;
function LateUpdate () {
Apply (transform, Vector3.zero);
distance =( Time.deltaTime*Input.GetAxis("Mouse ScrollWheel")*20 +1)* distance;
if (Input.GetKeyDown(KeyCode.PageUp)){
addHeight = true;
}
if (Input.GetKeyUp(KeyCode.PageUp)){
addHeight = false;
}
if (Input.GetKeyDown(KeyCode.PageDown)){
minusHeight = true;
}
if (Input.GetKeyUp(KeyCode.PageDown)){
minusHeight = false;
}
if (addHeight){
height = height + Time.deltaTime * 10;
}
if (minusHeight && height >=0){
height = height - Time.deltaTime * 10;
}
}