コード例 #1
0
        private void SoundVolumeChanged(ISound sound, float value)
        {
            var configuration = Mod.Instance.Settings.GetSoundsByCategoryId <string>(sound.CategoryId);

            if (!configuration.ContainsKey(sound.Id))
            {
                configuration.Add(sound.Id, new ConfigurationV4.Sound());
            }

            configuration[sound.Id].Volume = value;

            if (LoadingManager.instance.m_loadingComplete || !sound.IngameOnly)
            {
                sound.PatchVolume(value);
            }
            else
            {
                Mod.Instance.Log.Debug("Skip patching volume of {0}.{1} as there isn't a game active", sound.CategoryId, sound.Id);
            }
        }