From 80cff62241a7e10e46d54ba62648076e93a734a1 Mon Sep 17 00:00:00 2001 From: marcinzelent Date: Sun, 28 Apr 2019 03:40:14 +0200 Subject: Added title screen --- nGJ2019/Assets/Scripts/TitleScreen.cs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 nGJ2019/Assets/Scripts/TitleScreen.cs (limited to 'nGJ2019/Assets/Scripts/TitleScreen.cs') diff --git a/nGJ2019/Assets/Scripts/TitleScreen.cs b/nGJ2019/Assets/Scripts/TitleScreen.cs new file mode 100644 index 0000000..d439c51 --- /dev/null +++ b/nGJ2019/Assets/Scripts/TitleScreen.cs @@ -0,0 +1,25 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.EventSystems; +using UnityEngine.SceneManagement; + +public class TitleScreen : MonoBehaviour +{ + void Update() + { + // quit application when back button is clicked + if (Input.GetKeyDown(KeyCode.Escape)) + Application.Quit(); + } + + public void ToLevel1() + { + SceneManager.LoadScene("Level1"); + } + + public void Quit() + { + Application.Quit(); + } +} -- cgit v1.2.3