I really don’t know why my SceneManager.LoadScene does not load the game scene. I have two scenes, Game and MainMenu. In MainMenu I have a Canvas and a Text on it. I added a Button component.
I have a GameMaster C# script:
using UnityEngine;
using UnityEngine.SceneManagement;
public class GameMaster : MonoBehaviour
{
public void GoToGameScene()
{
SceneManager.LoadScene(1);
}
}
I created a new Empty Object in MainMenu scene, renamed it to GameMaster. I added the GameMaster script to it and then I added the GameMaster object to the Play button on Click. I selected the GameMaster.GoToGameScene method for the on Click.
When I run the game, the button click does not open the Game scene.