Skip to content

Instantly share code, notes, and snippets.

@takashiski
Created December 1, 2014 05:28
Show Gist options
  • Save takashiski/40e104868465970b280b to your computer and use it in GitHub Desktop.
Save takashiski/40e104868465970b280b to your computer and use it in GitHub Desktop.
タイトル画面やリザルト画面ででアプリケーションを終了したり、特定のシーンに飛んだりするためによく使うやつ
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