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

public class AudioManger : Singleton<AudioManger> {

    protected override void Awake()
    {
        base.Awake();

        if (FindObjectsOfType<AudioManger>().Length > 1)
        {
            Destroy(gameObject);
        }
    }

    void Start () {
        //inicializar objetos de audio
        MusicPlayerInitData musicData = new MusicPlayerInitData();
        MusicPlayer.Instance.Init(musicData);
        SoundEffectsPlayerInitData fxData = new SoundEffectsPlayerInitData();

        fxData.AddChangedVolumes(
        //    new KeyValuePair<string, float>("sfx-ari-chegando", 0.5f),
        //    new KeyValuePair<string, float>("sfx-ari-morrendo", 0.5f),
        //    new KeyValuePair<string, float>("sfx-ari-roncando-1", 0.2f),
        //    new KeyValuePair<string, float>("sfx-ari-roncando-2", 0.2f),
        //    new KeyValuePair<string, float>("sfx-ari-varrendo", 0.2f),
        //    new KeyValuePair<string, float>("sfx-bandeira-in", 0.75f),
        //    new KeyValuePair<string, float>("sfx-bandeira-out", 0.75f),
        //    new KeyValuePair<string, float>("sfx-chiado-tv", 0.1f),
        //    new KeyValuePair<string, float>("sfx-fase-selecionada", 0.5f),
        //    new KeyValuePair<string, float>("sfx-garra-abrindo", 0.25f),
        //    new KeyValuePair<string, float>("sfx-garra-fechando", 0.25f),
        //    new KeyValuePair<string, float>("sfx-garra-descendo", 0.25f),
        //    new KeyValuePair<string, float>("sfx-garra-subindo", 0.25f),
            new KeyValuePair<string, float>("sfx-ilha-swipe", 0.5f),
            new KeyValuePair<string, float>("sfx-load-entrada", 0.5f),
        //    new KeyValuePair<string, float>("sfx-load-saida", 0.5f),
        //    new KeyValuePair<string, float>("sfx-tile-azul", 0.5f),
            new KeyValuePair<string, float>("sfx-tile-azul-2", 0.5f),
        //    new KeyValuePair<string, float>("sfx-tile-especial", 0.5f),
        //    new KeyValuePair<string, float>("sfx-tile-especial-2", 0.65f),
        //    new KeyValuePair<string, float>("sfx-tile-efeito-amarelo", 0.75f),
            new KeyValuePair<string, float>("sfx-tile-efeito-roxo", 0.7f),
            new KeyValuePair<string, float>("sfx-tile-efeito-verde", 0.75f)//,
        //    new KeyValuePair<string, float>("sfx-tile-generico", 0.5f),
        //    new KeyValuePair<string, float>("sfx-tile-generico-2", 0.5f),
        //    new KeyValuePair<string, float>("sfx-tile-quicou", 0.5f)
            );

        SoundEffectsPlayer.Instance.Init(fxData);

        MusicPlayer.Instance.PlayMusic("ggj18-talvez-final-1"); //musica menu
    }
}
