how to load the active scene unity

Code Example - how to load the active scene unity

                
                        using UnityEngine.SceneManagement;
using UnityEngine;

public class PlayerMovement : MonoBehaviour
{
	void LoadScene()
    {
    	SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
    }
}
                    
                
 

unity reload active scene

                        
                                private void LoadActiveScene(){
	SceneManager.LoadScene(SceneManager.GetActiveScene().name);
}
                            
                        
 

Related code examples