// создание popup для выхода из игры void SpawnPopUpQuit() { gameLogic = FindObjectOfType <GameLogic>(); if (gameLogic != null) { gameLogic.Pause(); } popUpQuitInstance = Instantiate(popUpQuit, transform.position, Quaternion.identity); popUpQuitInstance.transform.GetComponentInChildren <Canvas>().worldCamera = mainCamera; GameObject.Find("Quit").GetComponent <Button>().onClick.AddListener(() => sceneMng.ExitGame()); GameObject.Find("No").GetComponent <Button>().onClick.AddListener(() => CloseQuitPopUp()); }