using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
using System.Collections.Generic;
public class MainMenu : MonoBehaviour
{
public Button playButton;
public Button optionsButton;
public Button exitButton;
void Start()
{
playButton.onClick.AddListener(PlayGame);
optionsButton.onClick.AddListener(OpenOptions);
exitButton.onClick.AddListener(ExitGame);
}
void PlayGame()
{
SceneManager.LoadScene("game");
}
void OpenOptions()
{
SceneManager.LoadScene("OptionsMenu");
}
void ExitGame()
{
Application.Quit();
}
}
вроде проверил и никаких ошибок не нашел вот фал скрипта формата cs
скрипт на главное меню
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
using System.Collections.Generic;
public class MainMenu MonoBehaviour
{
public Button playButton;
public Button optionsButton;
public Button exitButton;
void Start()
{
playButton.onClick.AddListener(PlayGame);
optionsButton.onClick.AddListener(OpenOptions);
exitButton.onClick.AddListener(ExitGame);
}
void PlayGame()
{
SceneManager.LoadScene(game);
}
void OpenOptions()
{
SceneManager.LoadScene(OptionsMenu);
}
void ExitGame()
{
Application.Quit();
}
}