34 lines
777 B
C#
Raw Normal View History

2022-04-01 18:41:31 +08:00
using UnityEngine;
using UnityEngine.UI;
namespace Assets.Scripts.Scenes.VideoRide
{
public class ExplosiveScript : MonoBehaviour
{
Image image;
private void Awake()
{
image = transform.GetComponent<Image>();
}
float flag = 0f;
float alph = 0f;
private void Update()
{
flag += Time.deltaTime;
if (flag >= 1f)
{
alph -= Time.deltaTime;
if (alph <= 0)
{
flag = 0;
}
}
else
{
alph += Time.deltaTime;
}
image.color = new Color(image.color.r, image.color.g, image.color.b, alph);
}
}
}