using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Audio;
using UnityEngine.UI;

public class VolumeController : MonoBehaviour
{
    [SerializeField] AudioMixer Mixer;
    [SerializeField] Slider VolumeSlider;

    public static float Volume = .3f;

    void Start()
    {
        VolumeSlider.value = Volume;
        UpdateVolume(Volume);
        VolumeSlider.SetValueWithoutNotify(Volume);
    }

    void Update()
    {

    }

    public void UpdateVolume(float value)
    {
        Mixer.SetFloat("MyExposedParam", Mathf.Log10(value) * 20);
        Volume = value;
    }
}
