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

public class TutorialButton : MonoBehaviour
{
    [SerializeField] CanvasGroup _Tutorial;

    float alp = 1f;
    bool fadeFlag = false;

    private void Update()
    {
        if (fadeFlag)
            Fade();
    }
    public void OnButton()
    {
        fadeFlag = true;
    }

    void Fade()
    {
        if (alp >= 0)
            alp -= Time.deltaTime; 
        _Tutorial.alpha = alp;
        if (alp < 0)
            fadeFlag = false;

    }


}
