标签:canvas alpha time tco mono 效果 date get ima
RawImage logo = mainLogo.transform.FindChild("back/headBack/Logo").GetComponent<RawImage>();
void Update()
{
var r = logo.color.r;
var g = logo.color.g;
var b = logo.color.b;
var alpha = Mathf.PingPong(Time.time / 5f, 1);
logo.color = new Color(r, g, b, alpha);
}
//在unity简单使用案例
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class fade : MonoBehaviour
{
private Image image;
void Start()
{
image = GameObject.Find("Canvas/Image").GetComponent<Image>();
}
void Update()
{
var r = image.color.r;
var g = image.color.g;
var b = image.color.b;
var alpha = Mathf.PingPong(Time.time / 5f, 1);
image.color = new Color(r, g, b, alpha);
}
}
标签:canvas alpha time tco mono 效果 date get ima
原文地址:http://www.cnblogs.com/Study088/p/7222190.html