Use auto property.

This commit is contained in:
Huo Yaoyuan
2019-11-12 17:45:42 +08:00
parent 574de39b0d
commit bbeab6fa76
13 changed files with 31 additions and 60 deletions

View File

@ -30,8 +30,7 @@ namespace osu.Game.Overlays
private readonly BindableDouble muteAdjustment = new BindableDouble();
private readonly Bindable<bool> isMuted = new Bindable<bool>();
public Bindable<bool> IsMuted => isMuted;
public Bindable<bool> IsMuted { get; } = new Bindable<bool>();
[BackgroundDependencyLoader]
private void load(AudioManager audio, OsuColour colours)
@ -66,7 +65,7 @@ namespace osu.Game.Overlays
muteButton = new MuteButton
{
Margin = new MarginPadding { Top = 100 },
Current = { BindTarget = isMuted }
Current = { BindTarget = IsMuted }
}
}
},
@ -76,7 +75,7 @@ namespace osu.Game.Overlays
volumeMeterEffect.Bindable.BindTo(audio.VolumeSample);
volumeMeterMusic.Bindable.BindTo(audio.VolumeTrack);
isMuted.BindValueChanged(muted =>
IsMuted.BindValueChanged(muted =>
{
if (muted.NewValue)
audio.AddAdjustment(AdjustableProperty.Volume, muteAdjustment);