Created
March 24, 2020 03:43
-
-
Save beardordie/b9bb22e4c2dce03c41ed9aa949cdaf2c to your computer and use it in GitHub Desktop.
Unity - Press F5 to reload the current Scene. Used a lot in development. Probably remove before making a public build.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class F5ReloadScene : MonoBehaviour { | |
public KeyCode keyCode = KeyCode.F5; | |
// Update is called once per frame | |
void Update () { | |
if(Input.GetKeyDown(keyCode)) | |
{ | |
UnityEngine.SceneManagement.SceneManager.LoadScene(UnityEngine.SceneManagement.SceneManager.GetActiveScene().buildIndex); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment