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

public class Lista : MonoBehaviour, IPointerDownHandler, IPointerUpHandler {

	private Animator animator;
	private bool isHide;
	public float timeList = 1.5f;
	private float timel;
	private bool flagInit;
	public Text[] txtLista;

	void Awake(){
		flagInit = true;
	}

	void Start () {
		animator = GetComponent<Animator> ();
		timel = timeList;
		txtLista[0].text = "Level "+GCScript.contLvl;
		txtLista [1].text = ObjectsSpawnScript.toList [0];
		txtLista [2].text = ObjectsSpawnScript.toList [1];
		txtLista [3].text = ObjectsSpawnScript.toList [2];
	}
	
	void Update () {
		if (!animator.IsInTransition (0)) {
			animator.SetBool ("hide", isHide);
		}
		if (timel < 0 && flagInit) {
			isHide = true;
			flagInit = false;
		}
		timel -= Time.deltaTime;
	}

	public void OnPointerDown (PointerEventData eventData) {
		//isHide = !isHide;
	}

	public void OnPointerUp (PointerEventData eventData) {
		isHide = !isHide;
	}

}