示例#1
0
文件: Sound.cs 项目: Bjeck/Eravola
 void SetAudioSourceToInfoSettings(AudioSource source, AmbienceInfo info)
 {
     source.clip   = info.audio;
     source.volume = info.volume;
     source.loop   = info.loop;
     if (info.mixer != null)
     {
         source.outputAudioMixerGroup = info.mixer;
     }
 }
示例#2
0
文件: Sound.cs 项目: Bjeck/Eravola
    public void StopAmbient(AMBIENCES sound)
    {
        AmbienceInfo s = ambiences[sound];

        for (int i = 0; i < audiosources.Count; i++)
        {
            if (audiosources[i].clip == s.audio)
            {
                audiosources[i].Stop();
            }
        }
    }
示例#3
0
文件: Sound.cs 项目: Bjeck/Eravola
    public void PlayAmbient(AMBIENCES sound)
    {
        AmbienceInfo s = ambiences[sound];

        if (audiosources[poolidx].isPlaying)
        {
            FindNextUnusedSource();
        }

        SetAudioSourceToInfoSettings(audiosources[poolidx], s);
        audiosources[poolidx].Play();
    }