Unity 3D C# - Scripts ot true false not working

this is my script

using UnityEngine;
using System.Collections;

public class TheInterface : MonoBehaviour {

	//locat objects which controll camera movet 
	public GameObject CameraMovmentY;
	public GameObject CameraMovmentX;

	public GameObject BoolBoxSelection;

	// Use this for initialization
	void Start () {
		Screen.showCursor = false;
		Screen.lockCursor = true;
		
		CameraMovmentY.gameObject.GetComponent<MouseLook>().enabled = true;
		CameraMovmentX.gameObject.GetComponent<MouseLook>().enabled = true;
		
		BoolBoxSelection.gameObject.GetComponent<KillerBoxSelection>().enabled = true;
	}

	//true or false for if the exscape button is pressed
	bool TheExscapePressed = false;

	// Update is called once per frame
	void Update () {
		//if Esc is pressed bool disable and ename curosr movemnt and visability
		if (Input.GetKey(KeyCode.Escape)) 
		{
			if(TheExscapePressed = false)
			{
				Screen.showCursor = true;
				Screen.lockCursor = false;

				CameraMovmentY.gameObject.GetComponent<MouseLook>().enabled = false;
				CameraMovmentX.gameObject.GetComponent<MouseLook>().enabled = false;

				BoolBoxSelection.gameObject.GetComponent<KillerBoxSelection>().enabled = false;

				TheExscapePressed = true;
			}
			else
			{
				Screen.showCursor = false;
				Screen.lockCursor = true;

				CameraMovmentY.gameObject.GetComponent<MouseLook>().enabled = true;
				CameraMovmentX.gameObject.GetComponent<MouseLook>().enabled = true;

				BoolBoxSelection.gameObject.GetComponent<KillerBoxSelection>().enabled = true;

				 TheExscapePressed = false;
			}
		}
	}

	void OnGUI() {

			if(TheExscapePressed == true)
			{
				//Create a new Button at location 0,0, with a size of 100, 20. 
				//The text in the button will read "Rotate Once"
				if(GUI.Button(new Rect(0,0,100,20), "Exit Game")) {
					//if button is pressed, perform the following
					Application.Quit();
				}
				
				//create another button below "Rotate Once".
				//this is a  RepeatButton that will continue to perform its action every update
				if(GUI.Button(new Rect(0,25,100,20), "Exit To Menu")) {
					//if button is pressed, perform the following
					
				}
		}

	}


}

Forsome reson when i press esc nothing happends, im so confused, when i press esc its meant to show the mouse and the buttons, and when i press esc agian its ment to hide cursor and center it, kinda like call of duty, when in press esc during the game, can any one please help, this code should work, I don’t know!

Your problem is on this line:

if(TheExscapePressed = false)

You are assigning the value, not comparing the value. The code should be:

if(TheExscapePressed == false)

Or better yet:

if(!TheExscapePressed)

I think you should more careful when you edit your code and kown more about what method you will use…