Fisec/Assets/Scripts/Game02.cs
Gerard Gascón 9afd57306d init
2025-04-24 14:20:42 +02:00

34 lines
901 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Game02 : MonoBehaviour{
public GameObject death;
public GameObject unpressed;
public GameObject pressed;
// Start is called before the first frame update
void Start(){
}
// Update is called once per frame
void Update(){
if (Input.GetKeyDown(KeyCode.Space)){
Time.timeScale = 0;
StartCoroutine(Death());
unpressed.SetActive(false);
pressed.SetActive(true);
}
}
IEnumerator Death(){
yield return new WaitForSecondsRealtime(1);
death.SetActive(true);
yield return new WaitForSecondsRealtime(3.12f);
AudioManager.instance.Play("Explosion");
yield return new WaitForSecondsRealtime(0.86f);
FindObjectOfType<GameController>().LoseGame();
}
}