Pause Menu C# Script error CS1519: Unexpected symbol in class, struct, or interface member declaration

I’m having some trouble trying to get my script working for my pause menu after following this half hour long tutorial: How To Make A Pause Menu In Unity 5 - Tutorial Tuesdays - PixLab - YouTube and this isn’t the first time I’ve encountered issues with a script after following online tutorials. I’ve followed it to exactly match their script but I think there’s something I might be missing, here’s the scrip in case someone can spot where I’ve gone wrong:

using UnityEngine;
using UnityEngine.UI;
using System.Collections;

public class UIManager : MonoBehaviour
{

public class GameObject PauseMenu;

    public bool isPaused;

public object PauseMenu { get; private set; }

// Use this for initialization
void Start()
{
    isPaused = false;
}

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

    if (Input.GetButtonDown("Cancel"))
    {
        SwitchPause();
    }
}

void PauseGame(bool state)
{
    if (state)
    {
        PauseMenu.SetActive(true);
        Time.timeScale = 0.0f; //This pauses the Game
    }
    else
    {
        Time.timeScale = 1.0f; //This unpauses the Game
    }
    PauseMenu.SetActive(false);
}

public void SwitchPause()
{
    if (isPaused)
    {
        isPaused = false; //Changes the value
    }
    else
    {
        isPaused = true;
    }
}

}

I would really appreciate help on this because after spending hours searching and checking my script I still can’t figure out what’s wrong with it P:

@CraftyMaelyss ,it seems you are defining a class incorrectly as such in your public class GameObject PauseMenu line.

To define a class for c# as a Monobehaviour in Unity, normally you would want to do it as such:

using UnityEngine;
using System.Collections;

public class DoSomethingClass : Monobehaviour {
    //Put some methods, variables, functions, etc inside the class
}

Below is a simple script i whipped up that may be more what you are looking for.

using UnityEngine;
using System.Collections;

public class PauseGameTest : MonoBehaviour {

	public bool isPaused;
	public GameObject pauseMenu;
	public KeyCode pauseGameKey;

	void Start() {
		isPaused = false;
	}

	void Update() {
		if (Input.GetKeyDown (pauseGameKey)) {
			if (isPaused) {
				UnPauseGame ();
			} else {
				PauseGame ();
			}
		}
	}

	void PauseGame() {
		isPaused = true;
		pauseMenu.SetActive (true);
		Time.timeScale = 0;
	}

	void UnPauseGame() {
		isPaused = false;
		pauseMenu.SetActive (false);
		Time.timeScale = 1;
	}
}

It can be done more efficient with less functions and added lines of code but i think this will better illustrate the idea to you.

Let me know if you have any questions about it.