Why is my script not working?

using UnityEngine;
using System.Collections;

public class PauseMenu : MonoBehaviour

public string mainMenu;
public bool isPaused;
public GameObject pauseMenuCanvas;

// Update is called once per frame
void Update () 
if (isPaused) {
		pauseMenuCanvas.SetActive (true);
	} else
		pauseMenuCanvas.SetActive (false);

isPaused = !isPaused;

public void Resume ()
isPaused = false;

public void Exit ()


There’s an extra } after the else where you set the pauseMenuCanvas to inactive (line 14 in the code in the question. Please post all errors regarding your script as it comes up in the editor and do not post such “Check My Code!” questions without proper information, Googling a solution yourself and trying your best to solve the problem.