Beispiel #1
0
        public void Update()
        {
            if (!_canReproduceAudio)
            {
                return;
            }

            if (_currentMusic != null && ProfileManager.Current != null)
            {
                if (CUOEnviroment.Client.IsActive)
                {
                    if (!ProfileManager.Current.ReproduceSoundsInBackground)
                    {
                        _currentMusic.Volume = ProfileManager.Current.MusicVolume / Constants.SOUND_DELTA;
                    }
                }
                else if (!ProfileManager.Current.ReproduceSoundsInBackground && _currentMusic.Volume != 0.0f)
                {
                    _currentMusic.Volume = 0;
                }
            }

            _currentMusic?.Update();

            for (int i = 0; i < _currentSounds.Count; i++)
            {
                var sound = _currentSounds[i];

                if (!sound.IsPlaying())
                {
                    _currentSounds.RemoveAt(i--);
                }
            }
        }
Beispiel #2
0
        public void Update()
        {
            if (_currentMusic != null && Engine.Profile.Current != null)
            {
                if (Engine.Instance.IsActive)
                {
                    if (!Engine.Profile.Current.ReproduceSoundsInBackground)
                    {
                        _currentMusic.Volume = Engine.Profile.Current.MusicVolume / SOUND_DELTA;
                    }
                }
                else if (!Engine.Profile.Current.ReproduceSoundsInBackground && _currentMusic.Volume != 0)
                {
                    _currentMusic.Volume = 0;
                }
            }

            _currentMusic?.Update();
        }
Beispiel #3
0
 public void Update()
 {
     _currentMusic?.Update();
 }