This commit is contained in:
Gerard Gascón 2025-02-02 23:44:44 +01:00
commit f5c1616018
679 changed files with 188502 additions and 0 deletions

View file

@ -0,0 +1,47 @@
using System;
using System.Collections;
using DG.Tweening;
using SimpleTools.SceneManagement;
using TMPro;
using UnityEngine;
public class Interface : MonoBehaviour {
private static readonly int FadeOut = Animator.StringToHash("Fade");
[SerializeField] private TMP_Text title;
private bool _titleHidden;
[SerializeField] private CanvasGroup gameOver;
private bool _dead;
[SerializeField] private Animator anim;
private void Start() {
gameOver.alpha = 0;
}
public void PlacePiece() {
if (_titleHidden)
return;
_titleHidden = true;
title.DOFade(0f, 2f);
}
public void Die() {
if (_dead)
return;
_dead = true;
gameOver.DOFade(1f, 1f);
}
public void Retry() {
StartCoroutine(RetryRoutine());
}
private IEnumerator RetryRoutine() {
anim.SetTrigger(FadeOut);
yield return new WaitForSeconds(1f);
Loader.Load("Level 1");
}
}