My prototype uses OnClick to fire projectiles, but so does my button

It seems to me there should be an extremely simple and elegant solution to my problem, but the problem is I don’t know what it is. Of course I could be wrong and I will have to come up with an elaborate set of if/else statements.

I am using OnClick to fire multiple projectiles. The idea is to make everything playable, clickable, selectable, with just left click, as ultimately if I progress the idea far enough I would want it to be something that could be ported to smartphones (mobile gaming). So I know right now I could just switch fire to space bar or any other key, and keep the click for the button.

But I don’t know how that would be ported.

Can’t I just put my button/GUI on a separate layer, and so if a click happens on that layer, the projectile won’t fire? Or make it so that mouse movements for firing OnClick are only ‘active’ when the mouse/click is in a certain part of the screen (lets call it the top half, for simplicity)?

public void SpawnPrefab()
    {
      if (Input.GetButtonDown("Fire1")) 
      {  
        ShootPrefab();
      }
    }
    public void ShootPrefab()
    {
        GameObject ball = Instantiate(projectile, transform.position, transform.rotation) as GameObject;
        // mouse position
        Vector3 posInScreen = Camera.main.WorldToScreenPoint(transform.position);
        // normalize direction
        Vector3 dirToMouse = Input.mousePosition - posInScreen;
        dirToMouse.Normalize();
        Debug.Log(dirToMouse);
        // combine force and vector
        ball.GetComponent<Rigidbody2D>().AddForce(dirToMouse * launchVelocity);
        balls.Add(ball);
    }

And the button code is pretty generic, from one of the Creating with Code tutorials:

   void Start()
        {
           button = GetComponent<Button>();
           button.onClick.AddListener(SetPreshot);
           gameManager = GameObject.Find("Game Manager").GetComponent<GameManager>(); 
        }

One thing that has occurred to me, beyond using space bar or multiple touches (which seems complicated but would work?) is to use OnMouseUp? Tell the user that to push the button they must click, then hold, and release over the button? Would be a bit unwieldy but I could just move the button close to where I know players are clicking?

This isn’t urgent, just something I am brainstorming at the moment.

Any ideas? Is it possible to use layers like this?

Can onClick be cordoned off? So that it only triggers an Instantiated object say if the mouse click was y >0?