private void Update()
    {
        if (Input.GetKeyDown(KeyCode.Escape))
        {
            var param = new Dictionary <string, object>();
            param.Add("Message", "выход");
            param.Add("Action", new Action <bool>(flag =>
            {
                if (flag)
                {
#if UNITY_EDITOR
                    EditorApplication.isPlaying = false;
#endif
                    Application.Quit();
                }
            }));
            MessageBoxManager.Open(MessageBoxId.Confirmation, param);
        }
    }