I was wondering what's the easiest way of writing an if statement to find when my intiger `var a` becomes 5 more than it's previous value?
function Update () {
passed = temps + threshold;
if(Input.GetMouseButton(0)){
temps += 1 * Time.deltaTime;
}
}
function LateUpdate(){
if (Input.GetMouseButtonUp(0) && CheckIntPassedLimit()){
//Do Something
}
}
function CheckIntPassedLimit() : boolean{
return (temps > passed);
}