Prevent mouse input trough GUI button on mobile game Unity 2019.4

Hello Community, so i am working on mobile game i use mouse input to control the player, in mobile device its working as touch,so when i press pause button its input trough GUI button in mobile device, but not at editor, Thanks

You can check if the mouse/touch is over a ui object using the event system.

Code

using UnityEngine.EventSystems; // needed

if(!EventSystem.current.IsPointerOverGameObject())
{
// Do your thing.
}