end scenes working now yippiee :D

This commit is contained in:
cemt1363
2026-06-07 05:03:50 +02:00
parent 6f33be5600
commit 4646b02849
6 changed files with 295 additions and 73 deletions
+5 -2
View File
@@ -8,6 +8,9 @@ public class GameOverScript : MonoBehaviour
public GameObject image;
private float elapsed;
[SerializeField]
private float duration = 2.0f;
void Start()
{
image.SetActive(false);
@@ -18,11 +21,11 @@ public class GameOverScript : MonoBehaviour
void Update()
{
elapsed += Time.deltaTime;
if(elapsed >= 2.0f) {
if(elapsed >= duration) {
image.SetActive(true);
if (Input.anyKeyDown)
{
SceneManager.LoadScene("0_Main scene");
SceneManager.LoadScene(0, LoadSceneMode.Single);
}
}