예제 #1
0
    /// <summary>
    /// 播放环境音乐
    /// </summary>
    /// <param name="audioEnvironment"></param>
    public void PlayEnvironment(AudioEnvironmentEnum audioEnvironment, float volumeScale)
    {
        AudioClip audioClip = null;

        //switch (audioEnvironment)
        //{

        //}
        audioSourceForEnvironment.volume = volumeScale;
        audioSourceForEnvironment.clip   = audioClip;
        audioSourceForEnvironment.Play();
    }
예제 #2
0
    /// <summary>
    /// 播放环境音乐
    /// </summary>
    /// <param name="audioEnvironment"></param>
    public void PlayEnvironment(AudioEnvironmentEnum audioEnvironment, float volumeScale)
    {
        AudioClip audioClip = null;

        switch (audioEnvironment)
        {
        case AudioEnvironmentEnum.Rain:
            audioClip = manager.GetEnvironmentClip("environment_rain_1");
            break;

        case AudioEnvironmentEnum.Wind:
            audioClip = manager.GetEnvironmentClip("environment_wind_1");
            break;
        }
        audioSourceForEnvironment.volume = volumeScale;
        audioSourceForEnvironment.clip   = audioClip;
        audioSourceForEnvironment.Play();
    }