Hello again (today second time)
Problem
I have a game with 2 scenes and one EventSystem in second scene. As I can understand EventSystem can be only in one scene and in this case I've found LoadSceneMode.Additive method that works fine in editor but gives freezed first screen in Build version.
Here are scripts for my both scenes
Scene one (menu) :
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class menu : MonoBehaviour
{
public void PlayGame()
{
SceneManager.LoadScene(1);
}
public void QuitGame()
{
Debug.Log("Quit OK");
Application.Quit();
}
}
And the second scene (marked as Active Scene)
public class PauseMenu : MonoBehaviour
{
public static bool GameIsPaused = false;
public GameObject pauseMenuUI;
void Update()
{
if(Input.GetKeyDown(KeyCode.Escape))
{
if(GameIsPaused)
{
Resume();
}
else
{
Pause();
}
}
}
public void Pause()
{
pauseMenuUI.SetActive(true);
Time.timeScale = 0f;
GameIsPaused = true;
}
public void Resume()
{
pauseMenuUI.SetActive(false);
Time.timeScale = 1f;
GameIsPaused = false;
}
public void LoadMenu()
{
SceneManager.LoadScene(0, LoadSceneMode.Additive);
pauseMenuUI.SetActive(false);
Time.timeScale = 1f;
GameIsPaused = false;
Debug.Log("Scene change activated");
}
public void QuitGame()
{
Application.Quit();
Debug.Log("Quit activated");
}
}
And my hierarchy screenshot
Please assist, what do I miss to do in order to work in Build version as good as in editor mode?
Thank you