您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
29 行
581 B
29 行
581 B
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using System.Collections;
|
|
|
|
[ExecuteInEditMode]
|
|
public class CameraFadeControl : MonoBehaviour
|
|
{
|
|
public float Opacity = 0.0f;
|
|
public Image FadeImage;
|
|
|
|
// Use this for initialization
|
|
void Start()
|
|
{
|
|
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
if (Opacity > 0)
|
|
FadeImage.gameObject.SetActive(true);
|
|
else
|
|
FadeImage.gameObject.SetActive(false);
|
|
|
|
Color c = FadeImage.color;
|
|
FadeImage.color = new Color(c.r, c.g, c.b, Opacity);
|
|
|
|
}
|
|
}
|