﻿using UnityEngine;
using System.Collections;

public class BackToMenu : MonoBehaviour {

	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
		if(Input.GetKeyDown(KeyCode.Escape)){
			Application.LoadLevel(0);
			GameObject GUI;
			GUI = GameObject.Find("GUISYSTEM");
			Destroy(GUI);
		}
	}
}

﻿using UnityEngine;
using System.Collections;

public class BackToMenu : MonoBehaviour {

	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
		if(Input.GetKeyDown(KeyCode.Escape)){
			Application.LoadLevel(0);
			GameObject guiSys;
			guiSys = GameObject.Find("GUISYSTEM");
			Destroy(guiSys);
			GameObject networkC;
			networkC = GameObject.Find("NetworkController");
			Destroy(networkC);
		}
	}
}

Destroy NetworkController when going back to menu
Destroy NetworkController when going back to menu
