예제 #1
0
        private void Start()
        {
            if (JCS_Camera.main == null)
            {
                JCS_Debug.LogError("There is no 'JCS_Camera' assign!");
                return;
            }

            JCS_SoundSettings ss = JCS_SoundSettings.instance;

            // Reset the sound every scene
            SetSFXSoundVolume(ss.GetSFXSound_Volume());
            SetSkillsSoundVolume(ss.GetSkillsSound_Volume());
            SetSFXSoundMute(ss.EFFECT_MUTE);
            SetSkillsSoundMute(ss.PERFONAL_EFFECT_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);
        }