This commit is contained in:
Gerard Gascón 2025-04-24 17:43:50 +02:00
commit 78b901484a
323 changed files with 109774 additions and 0 deletions

View file

@ -0,0 +1,46 @@
using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
public class CutsceneTextManager : MonoBehaviour{
[SerializeField] Animator cutscene;
[SerializeField] TextMeshProUGUI text;
[Space]
[TextArea] [SerializeField] string[] texts;
int currentText;
Animator anim;
void Awake(){
anim = GetComponent<Animator>();
}
// Start is called before the first frame update
void Start(){
}
// Update is called once per frame
void Update(){
if (Input.anyKeyDown){
anim.SetTrigger("Change");
}
}
public void UpdateText(){
if((texts.Length - 1) >= currentText){
if(currentText == 1){
cutscene.SetTrigger("Start");
}
AudioManager.instance.Play("Cutscene" + (currentText + 1), false);
text.text = texts[currentText];
currentText++;
}else{
text.gameObject.SetActive(false);
SceneLoader.instance.LoadScene(1, SceneLoader.DifficultySelected.Easy);
}
}
}