У нас вы можете посмотреть бесплатно How to Create a Pause Menu in Unity — Full Tutorial (With Working Buttons!) или скачать в максимальном доступном качестве, видео которое было загружено на ютуб. Для загрузки выберите вариант из формы ниже:
Если кнопки скачивания не
загрузились
НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием видео, пожалуйста напишите в поддержку по адресу внизу
страницы.
Спасибо за использование сервиса ClipSaver.ru
Learn how to create a fully functional Pause Menu in Unity with working buttons! In this tutorial, I walk you through setting up a simple and effective pause system that includes buttons for Resume, Main Menu, and Quit. What you'll learn: How to pause and resume the game How to use static variables How to create full functional buttons FULL SCRIPT: using UnityEngine; using UnityEngine.SceneManagement; public class GameManagerBehavior : MonoBehaviour { [SerializeField] GameObject pauseMenu; public static bool isPaused; // Start is called once before the first execution of Update after the MonoBehaviour is created void Start() { pauseMenu.SetActive(false); isPaused = false; } // Update is called once per frame void Update() { if (Input.GetKeyDown(KeyCode.Escape)) { if (!isPaused) { PauseGame(); } else { ResumeGame(); } } } private void PauseGame() { pauseMenu.SetActive(true); isPaused = true; Time.timeScale = 0f; } public void ResumeGame() { pauseMenu.SetActive(false); isPaused = false; Time.timeScale = 1f; } public void MainMenu() { Time.timeScale = 1f; SceneManager.LoadScene("MainMenu"); } public void QuitGame() { Application.Quit(); } } #Unity #GameDev #PauseMenu