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呼吸灯效果
最新推荐文章于 2026-07-14 15:15:42 发布

6936

被折叠的 条评论
为什么被折叠?



