Scripting a menu [Noob Problems]

Well, I have a button “menu” on the UI and i want press it to show a canvas. I have this code:

using UnityEngine;
using System.Collections;

public class menuScript : MonoBehaviour {

    public GameObject PauseUI;
    public GameObject menu;
    private bool paused = false;

    void Start () {
        PauseUI.SetActive(false);
    }

    void Update () {
        if (Input.GetButtonDown("menu")) {
            paused = ! paused;
        }
        if (paused)
        {
            PauseUI.SetActive(true);
            Time.timeScale = 0;
        }
        if (!paused)
        {
            PauseUI.SetActive(false);
            Time.timeScale = 1;
        }
    }
}

When I asociated the “menu” button with my public gameobject menu, but when i press it canvas still hiden

(Input.GetButtonDown("menu"))

this refers to a keyboard button press…

how to setup UI buttons: https://unity3d.com/learn/tutorials/modules/beginner/ui/ui-button?playlist=17111

Many many thanks

Sooo the code will be:

using UnityEngine;
using System.Collections;

public class menuScript : MonoBehaviour {

    public GameObject PauseUI;
    private bool paused = false;
    void Start () {
        PauseUI.SetActive(false);
    }

  public void onClick()
    {
        paused = !paused;
        if (paused)
        {
            PauseUI.SetActive(true);
            Time.timeScale = 0;
        }
        if (!paused)
        {
            PauseUI.SetActive(false);
            Time.timeScale = 1;
        }
    }
}