using System.Collections;
using System.Collections.Generic;
using UnityEngine;

[RequireComponent (typeof (Light))]
public class AudioOnLight : MonoBehaviour
{
    public AudioPeer _audioPeer;

    public int _band;
    public float _minIntensity, _maxIntensity;
    Light _light;

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

    void Update()
    {
        _light.intensity = (_audioPeer._audioBandBuffer[_band] * (_maxIntensity - _minIntensity)) + _minIntensity;
    }
}
