您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
19 行
444 B
19 行
444 B
using UnityEngine;
|
|
|
|
public class VisibleOnlyDuringNight : MonoBehaviour
|
|
{
|
|
LightColorController m_LightController;
|
|
Renderer m_Renderer;
|
|
|
|
void Awake()
|
|
{
|
|
m_LightController = FindObjectOfType<LightColorController>();
|
|
m_Renderer = GetComponent<Renderer>();
|
|
}
|
|
|
|
void Update()
|
|
{
|
|
if (m_Renderer != null && m_LightController != null)
|
|
m_Renderer.enabled = m_LightController.timeValue > 0.0f;
|
|
}
|
|
}
|