Last active
October 7, 2017 13:02
-
-
Save GOROman/7b6dc756eb6b3be566e1d327c086a773 to your computer and use it in GitHub Desktop.
VR展示とかで便利なシーンをキーボードのキーでリロードする
This file contains hidden or 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 UnityEngine; | |
using UnityEngine.SceneManagement; | |
public class SceneReloader : MonoBehaviour { | |
public KeyCode reloadKey = KeyCode.Tab; // このキーを押すとシーンリロードする | |
public int reloadScene = 0; // リロード時のシーン番号 | |
void Update () { | |
if ( Input.GetKeyDown( reloadKey ) ) | |
{ | |
print( "Reload Scene" ); | |
SceneManager.LoadScene( reloadScene ); | |
} | |
} | |
} |
Oculus Remoteとかでリロードやリセンター出来るようにすると更に便利。
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
適当なオブジェクトにこのスクリプトを追加して使えます。
デフォルトではTABキーでリロード。