load current scene unity code example
Example 1: how to load the active scene unity
using UnityEngine.SceneManagement;
using UnityEngine;
public class PlayerMovement : MonoBehaviour
{
void LoadScene()
{
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
}
}
Example 2: unity how to get the current scene
SceneManager.GetActiveScene().buildIndex;