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

public class SoundController : MonoBehaviour
{

    FMOD.Studio.EventInstance seTestEvent;

    FMOD.Studio.Bus Master;
    FMOD.Studio.Bus Music;
    FMOD.Studio.Bus SoundEffects;

    public float volume_music = 0.5f;
    public float volume_master = 1f;
    public float volume_soundEffects = 0.5f;


    void Awake()
    {
        Music = FMODUnity.RuntimeManager.GetBus("bus:/Music");
        SoundEffects = FMODUnity.RuntimeManager.GetBus("bus:/SoundEffects");
        Master = FMODUnity.RuntimeManager.GetBus("bus:/");
    }

    void Update()
    {
        Master.setVolume(volume_master);
        Music.setVolume(volume_music);
        SoundEffects.setVolume(volume_soundEffects);
    }

    public void SetVolume_master(float newMasterVolume)
    {
        volume_master = newMasterVolume;
    }

    public void SetVolume_music(float newmusicvolume)
    {
        volume_music = newmusicvolume;
    }

    public void SetVolume_soundEffects(float newsoundeffvolume)
    {
        volume_soundEffects = newsoundeffvolume;

    }
}
