scenemangar.loadscence loads wrong scene code example
Example 1: unity load scene
using UnityEngine.SceneManagement;
SceneManager.LoadScene("Scene name");
Example 2: how to switch scenes unity
SceneManager.LoadScene("MyScene");
Example 3: scene manager unity
using UnityEngine;
using UnityEngine.SceneManagement;
public class ExampleScript: MonoBehaviour
{
public string Scene;
void Start()
{
SceneManager.LoadScene(Scene);
}
}
Example 4: loadscene unity
using UnityEngine;
using UnityEngine.SceneManagement;
public class Singleplayer : MonoBehaviour
{
public void LoadNextLevel()
{
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex +1);
}
}