コード例 #1
0
        /// <summary>
        /// Switch the background music, fading in and out.
        /// </summary>
        /// <param name="soundClip"> clip to play. </param>
        /// <param name="fadeTime"> time to fade in and out. </param>
        /// <param name="loop"> loop music? </param>
        public void SwitchBackgroundMusic(
            AudioClip soundClip,
            bool loop = true)
        {
            JCS_SoundSettings ss = JCS_SoundSettings.instance;

            SwitchBackgroundMusic(
                soundClip,
                ss.GetSoundFadeOutTimeBaseOnSetting(),
                ss.GetSoundFadeInTimeBaseOnSetting());
        }
コード例 #2
0
        /// <summary>
        /// Play one shot background music, after playing it.
        /// Play the on stack sound.
        /// </summary>
        /// <param name="oneShotClip"> One shot BGM </param>
        /// <param name="onStackClip"> Audio clip on stack </param>
        public bool PlayOneShotBackgroundMusic(
            AudioClip oneShotClip,
            AudioClip onStackClip)
        {
            JCS_SoundSettings ss = JCS_SoundSettings.instance;

            return(PlayOneShotBackgroundMusic(
                       oneShotClip,
                       onStackClip,
                       ss.GetSoundFadeOutTimeBaseOnSetting(),
                       ss.GetSoundFadeInTimeBaseOnSetting()));
        }