34 lines
779 B
C#
34 lines
779 B
C#
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 >= 0.5f)
|
|
{
|
|
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);
|
|
}
|
|
}
|
|
}
|