//void Awake()
    //{
    //    aud = GetComponent<AudioSource>();
    //    aud.loop = true;
    //    aud.playOnAwake = false;
    //    aud.volume = PlayerPrefs.GetFloat("BGM");
    //}

    public void SetBGM(SceneManagerScript maf, string name)
    {
        maf.GetBGMVolume();
        switch (name)
        {
        case "Title":
            aud.clip = BGMgroup[0];
            break;

        case "StageSelect":
            aud.clip = BGMgroup[1];
            break;

        case "Stage1_Red":
        case "Stage2_Orange":
        case "Stage3_Yellow":
        case "Stage4_Green":
        case "Stage5_Blue":
        case "Stage6_Indigo":
        case "Stage7_Purple":
            aud.clip = BGMgroup[2];
            break;

        case "Start":
            aud.clip = BGMgroup[3];
            break;

        case "Config":
            aud.clip = BGMgroup[4];
            break;

        case "GameClear":
            aud.clip = BGMgroup[5];
            break;
        }
        aud.Play();
    }
    void Start()
    {
        Config_State = SelectState.BGMSlide;
        BGMValue     = BGMslider.GetComponent <Slider>();
        SEValue      = SEslider.GetComponent <Slider>();

        var manage = GameObject.FindGameObjectWithTag("AllScene");

        if (manage)
        {
            managerScript = manage.GetComponent <SceneManagerScript>();
            var data  = managerScript.GetClearData();
            var count = 0;
            for (int i = 0; i < data.Length / 2; i++)
            {
                if (data[i, 1] == 1)
                {
                    count++;
                }
            }
            numtext.text = count + "/7";

            BGMValue.value = managerScript.GetBGMVolume();
            SEValue.value  = managerScript.GetSEVolume();
            var val = PlayerPrefs.GetFloat("BGM");
            if (BGMValue.value != val)
            {
                BGMValue.value = PlayerPrefs.GetFloat("BGM", 1);
                SEValue.value  = PlayerPrefs.GetFloat("SE", 1);
            }
            audio = manage.GetComponent <AudioSource>();
        }
        else
        {
            BGMValue.value = PlayerPrefs.GetFloat("BGM", 1);
            SEValue.value  = PlayerPrefs.GetFloat("SE", 1);
        }
        IconDistance = BGMValue.transform.localPosition - SEValue.transform.localPosition;
        text         = img.transform.GetChild(0).GetComponent <Text>();
        img.sprite   = spriteA;
        mute1        = transform.GetChild(2).GetChild(5).gameObject;
        mute2        = transform.GetChild(3).GetChild(5).gameObject;
        if (BGMValue.value == 0)
        {
            mute1.SetActive(true);
        }
        else
        {
            mute1.SetActive(false);
        }
        if (SEValue.value == 0)
        {
            mute2.SetActive(true);
        }
        else
        {
            mute2.SetActive(false);
        }
        buttonA     = Resources.Load <AudioClip>("Sound\\SE\\decision29");
        buttonB     = Resources.Load <AudioClip>("Sound\\SE\\cancel2");
        warning     = Resources.Load <AudioClip>("Sound\\SE\\warning2");
        audioButton = gameObject.AddComponent <AudioSource>();
    }