-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTimeManager.cs
More file actions
36 lines (31 loc) · 903 Bytes
/
TimeManager.cs
File metadata and controls
36 lines (31 loc) · 903 Bytes
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
using TMPro;
using UnityEngine;
using UnityEngine.SocialPlatforms.Impl;
public class TimeManager : MonoBehaviour
{
// UI
//[SerializeField] private TextMeshProUGUI _timeScaleText;
//[SerializeField] private TextMeshProUGUI _scoreText;
[SerializeField] private int _score;
void Update()
{
if (Input.GetKeyDown(KeyCode.Q))
Time.timeScale = 0.2f;
if (Input.GetKeyDown(KeyCode.E))
Time.timeScale = 1f;
if (Input.GetKeyDown(KeyCode.Space))
{
if (Time.timeScale == 0f)
Time.timeScale = 1f;
else
Time.timeScale = 0f;
}
// Update UI
//_timeScaleText.text = $"Time Scale: {Time.timeScale:F1}";
//_scoreText.text = $"Score: {_score}";
}
public void AddScore()
{
_score++;
}
}