How can I set up an in-game menu?

So I’m trying to make it so if I click the “Menu” Button in the top left corner, a menu comes up. Then on that menu, you can click “Resume” or “Exit”. Here’s what it looks like. Screenshot by Lightshot

I’ve been trying to get a working script for it, here’s what I have so far, but I’m having issues. Screenshot by Lightshot

I managed to get a Main Menu working last night, but I can’t figure out how to get this in-game menu working. I would like the “Menu” button to open up the menu, and the “Resume” button to close the menu, and the “Exit” button to go back to the main menu.

Any help would be greatly appreciated :stuck_out_tongue:

If you want to set it up with the inspector, select the button, add On Click event handlers and route them to your canvas / GameObject.SetActive.

If you want to set up callbacks with code:

menuButton.onClick.AddListener(() => MenuCanvas.SetActive(true));
resumeText.onClick.AddListener(() => MenuCanvas.SetActive(false));
exitText.onClick.AddListener(() => GameUICanvas.SetActive(true));

Or something similar…