Esempio n. 1
0
        /// <summary>
        /// Sets the background music to the specified controller, fading out the old background music.
        /// </summary>
        /// <param name="bgm"></param>
        /// <param name="fadeDuration"></param>
        public void SetBGMWithFadeOut(IBackgroundMusic bgm, float fadeDuration = 0.5f)
        {
            if (this.currentBGM == null)
            {
                this.SetBGM(bgm);
                return;
            }

            this.currentBGM.FadeOut(fadeDuration, () => this.SetBGM(bgm));
        }
Esempio n. 2
0
        /// <summary>
        /// Sets the background music to the specified controller.
        /// </summary>
        /// <param name="bgm">The background music controller.</param>
        public void SetBGM(IBackgroundMusic bgm)
        {
            if (this.currentBGM != null)
            {
                this.currentBGM.Stop();
            }

            this.currentBGM = bgm;

            if (this.currentBGM != null)
            {
                this.onMusicVolumeChanged();
                this.onPitchChanged();
                this.onLowPassGainChanged();
                this.currentBGM.Start();
            }
        }
Esempio n. 3
0
 public static void Assign(IConfig config, ISettings settings, IThemes themes, IBackgroundMusic backgroundMusic,
                           IDrawing draw, IGraphics graphics, IFonts fonts, ILanguage language, IGame game, IProfiles profiles, IRecording record,
                           ISongs songs, IVideo video, ISound sound, ICover cover, IDataBase dataBase, IControllers controller, IPlaylist playlist)
 {
     Config          = config;
     Settings        = settings;
     Themes          = themes;
     BackgroundMusic = backgroundMusic;
     Drawing         = draw;
     Graphics        = graphics;
     Fonts           = fonts;
     Language        = language;
     Game            = game;
     Profiles        = profiles;
     Record          = record;
     Songs           = songs;
     Video           = video;
     Sound           = sound;
     Cover           = cover;
     DataBase        = dataBase;
     Controller      = controller;
     Playlist        = playlist;
 }
Esempio n. 4
0
 /// <summary>
 /// Sets the background music to the specified controller, crossfading between the two.
 /// </summary>
 /// <param name="bgm"></param>
 /// <param name="fadeDuration"></param>
 public void SetBGMWithCrossFade(IBackgroundMusic bgm, float fadeDuration = 0.5f)
 {
     throw new NotImplementedException();
 }