What shall I use to pause my game?

Hi friend I have builded a game that makes my charcater jump with every touch using

if (Input.touchCount > 0){
(if Input.GetTouch(0).phase == TouchPhase.Began){

But now when I need my pauseButtom for my game he jumps when I press the buttom. So I was thinking how I fix this in the best way. I was thinking on a eventrigger that know if any touch is over the buttom and I can say

(if Input.GetTouch(0).phase == TouchPhase.Began && mouseIsOver){}

But im not quite sure. Please help me think.

Hi again friends. After some food I realised the answer. I just used a 2 eventriggers on my buttom.

  1. For checking onEnter making jumpAble = false
  2. For checking onExit making jumpAble = true

Peace out friends