Check if touch position is NOT on GUITexture

Is there an easy way to find out of the players input touch is NOT on a GUITexture?

In my game, the player jumps when the player touched the screen, but when the player touches a button, he also jumps.

I can solve this with some codes across classes, but just wondering if there’s a more easy method

Set a variable to true when the GuiTexture is touched and to false when is not, and before jump check if this variable is true or false. This variable can be in an script attached to the player or where from the jump is performed, and edited from the script that handles the touch of the GUITexture

You can do a ray cast from the touch position and ignore it if the first thing it hits is a GUI element.

use Camera.ScreenPointToRay to do the cast.