Is there a more efficient way to check to see if a value is bewteen to other values than doing :
if(scrollPosition.x > Screen.width*.25 && scrollPosition.x < Screen.width *.49 || scrollPosition.x < Screen.width*.01 && scrollPosition.x > Screen.width*.25){
//code
}
it would be nice if you could do something like
if(Scroll.position.x.isBetween(.25, .49 || .01, .25)){
code//
}
Is it possible to create a function like this? Thanks for any help.
↧