using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class ShanShuoAnim : MonoBehaviour {
Text text;
public float speed;
// Use this for initialization
void Start ()
{
text = this.GetComponent<Text>();
}
void Update()
{
float r = text.color.r;
float g = text.color.g;
float b = text.color.b;
float alpha = Mathf.PingPong(speed * Time.time, 1); //speed * Time.time 速率
text.color = new Color(r, g, b, alpha);
}
}
简单的Unity闪烁效果
最新推荐文章于 2024-05-29 07:59:42 发布