Unity Point Light 定时器 闪亮效果~
2017-05-11 本文已影响0人
木子才
Untitled20170511165722.gif
3DD711F3-6A97-4C26-BC99-0B5EE0FD629C.png
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 对象上~~~