/
RealMotya
/
Platformer
Обзор
Документация
Войти
/
RealMotya
/
Platformer
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
Assets/_Scripts/MenuController.cs
48 строк
1 KB
VR4\IT-Cube28
Fear: добавил босса
29 янв 2026, 10:37
29 янв 2026, 10:37
ebc6168
Код
Авторство
О чём код?
using UnityEngine; using UnityEngine.SceneManagement; using UnityEngine.UI; public class MenuController : MonoBehaviour { public Button _continueButton; //������ ����������� ����. private void Start() { //������� ����� ��������� ���� �� ��� ��������. int num = PlayerPrefs.GetInt(nameof(SaveManager.LoadData.CheckpointNumber)); //���� �� ����� 0, ������ �� ���� ����������. �.�. ������ ���������� ���������� � 1. �������� ������ �����������. if (num == 0) { SaveManager.IsContinue = false; _continueButton.enabled = false; //���������� ������ ����������� ����. } else { SaveManager.IsContinue = true; //��������� ���� ����������� ����. } } public void StartGame() { //���������, ��� ���� ���������� �������. SaveManager.IsContinue = false; SceneManager.LoadScene(1); } public void Exit() => Application.Quit(); public void Continue() { if (SaveManager.IsContinue) { SaveManager.Load(); //�������� ������ SceneManager.LoadScene(SaveManager.LoadData.LevelNumber); //�������� ����������� �����. } } }