Created
December 1, 2014 05:28
-
-
Save takashiski/40e104868465970b280b to your computer and use it in GitHub Desktop.
タイトル画面やリザルト画面ででアプリケーションを終了したり、特定のシーンに飛んだりするためによく使うやつ
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 UnityEngine; | |
using System.Collections; | |
public class AppManager : MonoBehaviour { | |
public string jumpSceneName = "Title"; | |
public KeyCode jumpSceneKey = KeyCode.Return; | |
public KeyCode quitAppKey = KeyCode.Escape; | |
void Update () { | |
if (Input.GetKeyDown(quitAppKey)) | |
{ | |
Application.Quit(); | |
} | |
else if (Input.GetKeyDown(jumpSceneName)) | |
{ | |
Application.LoadLevel(jumpSceneName); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment