using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;

public class CinematicController : MonoBehaviour {

	private Animator anim;

	public GameObject buttonsQ1;
	public GameObject buttonsQ2;

	public Text sureMessage;

	public string[] MESSAGES = new string[]{
		"Eso no es algo que el abuelo haría", 
		"No entendiste la historia",
		"Vas a tener que repetirla"};
	private int currentIndex = 0;	

	void Awake() {
		this.anim = GetComponent<Animator>();
	}

	public void OnPlayButton() {
		anim.SetTrigger("Pause");
		buttonsQ2.SetActive(true);
	}

	public void OnKickButton() {
		anim.SetTrigger("continueStory");
	}

	public void OnYes() {
		if (currentIndex >= MESSAGES.Length) {
			currentIndex = 0;
		}
		sureMessage.text = MESSAGES[currentIndex];
		currentIndex++;
	}

	public void OnNo() {
		buttonsQ2.SetActive(false);
		OnKickButton();
	}

	public void FinishCinematic() {
		SceneManager.LoadScene(1);
	}

}
