timerControl 代码:
public class timerControl : MonoBehaviour {
private bool isClose;
// Use this for initialization
void Start () {
float value = Random.Range (0.1f, 1.0f);
InvokeRepeating ("setupLight",1,value);
}
// Update is called once per frame
void Update () {
}
void setupLight() {
Light light = GetComponent<Light> ();
light.enabled = isClose;
isClose = !isClose;
}
}
把这个脚本放到各个 Point Light 对象上~~~