1.还是Mathf数学类应用,制作渐隐黑屏效果,配合GameOver
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Background : MonoBehaviour {
public GUITexture m_background; //定义GUITexture组件公共对象m_background
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
m_background.color = new Color(0f, 0f, 0f, Mathf.Lerp(0.0f, 1.0f, Time.time * 0.1f)); //这是透明度改变的操作,透明度在Color属性里,三个0f表示RGB色,最后透明度在10s时间从全透明到全不透明
}
}