using UnityEngine;
using System.Collections;
using UnityEngine.UI;

public class TutorialPanel4 : TutorialPanel
{
    public Text text;

    protected override void OnEnable()
    {
        base.OnEnable();
        SetAlpha(text, 0);
        StartCoroutine(FadeInText());
    }

    private IEnumerator FadeInText()
    {
        float t = 0;
        while (t < 1)
        {
            SetAlpha(text, Mathf.Lerp(0, 1, t));
            t += Time.deltaTime;
            yield return null;
        }

        SetAlpha(pressAnyKey, 1);
    }

    public override void Dismiss()
    {
        GameFlow.getInstance().CurrentState = GameMode.Spawning;
        Destroy(gameObject);
    }
}
