/
TitleScreen.cs
49 lines (43 loc) · 1.23 KB
/
TitleScreen.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class TitleScreen : MonoBehaviour
{
// public Sprite title;
// public Sprite info;
// private int sprite;
//private bool cooldown;
// private float timerCooldown;
void Start()
{
// sprite = 0;
}
void Update()
{
if (Input.GetButton("Jump")) { // space bar
SceneManager.LoadScene("Game");
}
// not needed at the moment - can be used to display info or other text on screen
/**
if (cooldown) {
timerCooldown += Time.deltaTime;
if (timerCooldown >= 0.5f) {
cooldown = false;
timerCooldown = 0;
}
}
if (Input.GetButton("Submit") && cooldown == false) { // enter/return key
if (sprite == 0) {
this.GetComponent<SpriteRenderer>().sprite = info;
sprite++;
}
else {
this.GetComponent<SpriteRenderer>().sprite = title;
sprite--;
}
cooldown = true;
}
*/
}
}