You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
CrowdControl/Assets/3rd/D2D_Scripts/Gameplay/FadeoutLifetimer.cs

22 lines
554 B
C#

3 months ago
using System.Collections;
using System.Collections.Generic;
using D2D.Utils;
using DG.Tweening;
using UnityEngine;
using UnityEngine.UI;
namespace D2D.Common
{
[RequireComponent(typeof(MaskableGraphic))]
public class FadeoutLifetimer : Lifetimer
{
[SerializeField] private float startFadeoutTime = .5f;
private IEnumerator Start()
{
yield return new WaitForSeconds(startFadeoutTime);
GetComponent<MaskableGraphic>().DOFade(0, CalculatedLifetime - startFadeoutTime);
}
}
}