I am using unity SceneManager but it gives me a namespace error that it does not exist in
using UnityEngine;
using UnityEngine.SceneManagement;
public class ManageGame : MonoBehaviour
{
bool gameHasEnded = false;
public void GameOver()
{
if (gameHasEnded == false)
{
gameHasEnded = true;
Debug.Log("GAME OVER");
Restart();
}
}
void Restart ()
{
SceneManagement.LoadSceneMode(SceneManager.GetActiveScene().name);
}
}
I read the official documentation about SceneManger and i checked the using part and it was the same.
My version is 2019.3.14.
Why does this happen?