Unity Point Light 定时器 闪亮效果~
2017-05-11 本文已影响0人
木子才


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 对象上~~~