This commit is contained in:
Gerard Gascón 2025-04-24 17:26:56 +02:00
commit e0a842f222
796 changed files with 361371 additions and 0 deletions

View file

@ -0,0 +1,38 @@
using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
public class GameOverScreen : MonoBehaviour{
[SerializeField] Animator fade;
[SerializeField] TMP_Text scoreText;
// Start is called before the first frame update
void Awake(){
int score = Mathf.Min(99999999, PlayerPrefs.GetInt("Score", 0));
string scoreStr = string.Empty;
for (int i = 0; i < 8 - score.ToString().Length; i++){
scoreStr += "0";
}
scoreStr += score.ToString();
scoreText.text = scoreStr;
}
public void Retry(){
AudioManager.instance.PlayOneShot("LevelStart");
StartCoroutine(Fade(3));
}
public void Quit(){
AudioManager.instance.FadeOut("MainMusic", 1f);
AudioManager.instance.PlayOneShot("MenuClick");
StartCoroutine(Fade(0));
}
IEnumerator Fade(int scene){
fade.SetTrigger("FadeIn");
yield return new WaitForSeconds(1f);
Loader.Load(scene);
}
}