using UnityEngine;
using System.Collections;
public class TestAlpha : MonoBehaviour {
public SpriteRenderer bo;
// Use this for initialization
void Start () {
}
float i = 0;
bool isShow = false;
// Update is called once per frame
void Update()
{
if (!isShow)
{
i += Time.deltaTime;
if (i < 0.5f)
{
Color s = bo.color;
s.a = 0.1f;
bo.color = s;
}
else if (i > 0.5f && i < 1)
{
Color s = bo.color;
s.a = 0.8f;
bo.color = s;
}
else
{
i = 0;
Color s = bo.color;
s.a = 1f;
bo.color = s;
isShow = true;
}
}
}
}
Unity呼吸灯效果
最新推荐文章于 2023-11-25 23:20:31 发布