init
This commit is contained in:
commit
78b901484a
323 changed files with 109774 additions and 0 deletions
46
Assets/Scripts/UI/CutsceneTextManager.cs
Normal file
46
Assets/Scripts/UI/CutsceneTextManager.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue