void Update() { if(Input.GetKey(KeyCode.Escape)) { if (pclient != null) { pclient.disconnect(); } Application.Quit(); } }