Scène de chargement d'unité
using UnityEngine.SceneManagement;
//Put this in whenever you want to load a scene
SceneManager.LoadScene("Scene name");
Artyom Gabtraupov
using UnityEngine.SceneManagement;
//Put this in whenever you want to load a scene
SceneManager.LoadScene("Scene name");
using UnityEngine.SceneManagement;
int buildIndex = 0;
//Load the scene with a build index
SceneManager.LoadScene(buildIndex);
void Start ()
{
// Create a temporary reference to the current scene.
Scene currentScene = SceneManager.GetActiveScene ();
// Retrieve the name of this scene.
string sceneName = currentScene.name;
}
void Update(){
if (sceneName == "Example 1")
{
// Do something...
}
}