Нажал начать игру в сцене с главным меню, кидает в сцену с игрой там я нажимаю на паузу и выхожу в меню, а там кнопки уже не работают.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class Buttons : MonoBehaviour
{
public GameObject load;
public void Game()
{
StartCoroutine(waitGame());
load.SetActive(true);
}
IEnumerator waitGame()
{
AsyncOperation loadGame = SceneManager.LoadSceneAsync(1);
yield return new WaitForSeconds(2);
while(!loadGame.isDone)
{
yield return null;
}
}
public void Options()
{
SceneManager.LoadScene(2);
}
public void ExitGame()
{
Application.Quit();
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class Pause : MonoBehaviour
{
[SerializeField]
GameObject pause;
void Start()
{
pause.SetActive(false);
}
// Update is called once per frame
void Update()
{
if(Input.GetKeyDown(KeyCode.Escape))
{
pause.SetActive(true);
Time.timeScale = 0;
}
}
public void PauseOff()
{
pause.SetActive(false);
Time.timeScale = 1;
}
public void Menu()
{
SceneManager.LoadScene(0);
Time.timeScale = 1;
}
}