public float intensity ;

描述

光的强度乘以光颜色。

该值可以介于 0 与 8 之间。这用于创建过亮的光。

using UnityEngine;

public class Example : MonoBehaviour { // Interpolate light color between two colors back and forth float duration = 1.0f; Color color0 = Color.red; Color color1 = Color.blue;

Light lt;

void Start() { lt = GetComponent<Light>(); }

void Update() { // set light color float t = Mathf.PingPong(Time.time, duration) / duration; lt.color = Color.Lerp(color0, color1, t); } }