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

public class ShadowAlpha : MonoBehaviour
{
    public float time;
    public bool status;
    public Image self;
    // Start is called before the first frame update
    void Awake()
    {
        status = true;
        self.color = new Color (0, 0, 0, 1);
    }

    // Update is called once per frame
    void Update()
    {
        if (time <1 && status)
        {
            time += Time.deltaTime;
            self.color = new Color (0, 0, 0, 1-time);
        }
        else
        {status = false;Destroy(gameObject);}
    }
}
