Mode : 그림자 고정, 실시간 등
Intensity : 빛의 세기
Indirect Multiplier : 간접광의 세기
Shadow Type : 그림자
window - lighting
반짝거리게 만들기
public class light : MonoBehaviour
{
private Light theLight;
private float targetIntensity;
private float currenIntensity;
void Start()
{
theLight = GetComponent<Light>();
currenIntensity = theLight.intensity;
targetIntensity = Random.Range(0.4f, 1f);
}
// Update is called once per frame
void Update()
{
if(Mathf.Abs(targetIntensity - currenIntensity) >= 0.01)
{
if (targetIntensity - currenIntensity >= 0)
currenIntensity += Time.deltaTime * 3f;
else
currenIntensity -= Time.deltaTime * 3f;
theLight.intensity = currenIntensity;
theLight.range = currenIntensity + 10;
}
else
{
targetIntensity = Random.Range(0.4f, 1f);
}
}
}