美文网首页
Unity Point Light 定时器 闪亮效果~

Unity Point Light 定时器 闪亮效果~

作者: 木子才 | 来源:发表于2017-05-11 17:01 被阅读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 对象上~~~

相关文章

网友评论

      本文标题:Unity Point Light 定时器 闪亮效果~

      本文链接:https://www.haomeiwen.com/subject/nqaotxtx.html