Esempio n. 1
0
    //=============================================================
    /// <summary>
    /// bgmをならす
    /// </summary>
    public void PlayBGM(string name)
    {
        if (!bgmDic.ContainsKey(name))
        {
            ErrorManager.ErrorLog(ErrorManager.ERROR_CODE.AUDIO_SE_NONE);
            return;
        }

        bgmSource.clip = bgmDic[name] as AudioClip;
        bgmSource.Play();
    }
Esempio n. 2
0
    //=============================================================
    /// <summary>
    /// seをならす
    /// </summary>
    public void PlaySE(string name)
    {
        if (!seDic.ContainsKey(name))
        {
            ErrorManager.ErrorLog(ErrorManager.ERROR_CODE.AUDIO_SE_NONE);
            return;
        }

        foreach (AudioSource se in seSourceList)
        {
            se.PlayOneShot(seDic[name] as AudioClip);
            return;
        }
    }