restart the game unity code example
Example 1: how to rerun unity game in code
SceneManager.LoadScene( SceneManager.GetActiveScene().name );
Example 2: how to rerun unity game in code
using UnityEngine.SceneManagement;
SceneManager.LoadScene( SceneManager.GetActiveScene().name );
using UnityEngine.SceneManagement;