Ejemplo n.º 1
0
        public void SetBackgroundMusic(AudioSource music)
        {
            this.mBGM = music;

            JCS_SoundSettings ss = JCS_SoundSettings.instance;

            this.mBGM.volume = ss.GetBGM_Volume();
            this.mBGM.mute   = ss.BGM_MUTE;
        }
        /// <summary>
        /// Play one shot of sound.
        /// </summary>
        /// <param name="clip"></param>
        /// <param name="type"></param>
        public void PlayOneShot(AudioClip clip, JCS_SoundSettingType type)
        {
            JCS_SoundSettings ss = JCS_SoundSettings.instance;

            float volume = 0;

            switch (type)
            {
            case JCS_SoundSettingType.BGM_SOUND:
                volume = ss.GetBGM_Volume();
                break;

            case JCS_SoundSettingType.SFX_SOUND:
                volume = ss.GetSFXSound_Volume();
                break;

            case JCS_SoundSettingType.SKILLS_SOUND:
                volume = ss.GetSkillsSound_Volume();
                break;
            }

            PlayOneShot(clip, volume);
        }