mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 16:59:53 +09:00
Initialize some bindables for prevent get the null instance.
This commit is contained in:
@ -28,9 +28,9 @@ namespace osu.Game.Rulesets.Mods
|
||||
|
||||
protected const float TRANSITION_DURATION = 100;
|
||||
|
||||
protected BindableNumber<int> CurrentCombo;
|
||||
protected readonly BindableNumber<int> CurrentCombo = new BindableInt();
|
||||
|
||||
protected IBindable<bool> IsBreakTime;
|
||||
protected readonly IBindable<bool> IsBreakTime = new Bindable<bool>();
|
||||
|
||||
protected float ComboBasedAlpha;
|
||||
|
||||
@ -40,14 +40,14 @@ namespace osu.Game.Rulesets.Mods
|
||||
|
||||
public void ApplyToPlayer(Player player)
|
||||
{
|
||||
IsBreakTime = player.IsBreakTime.GetBoundCopy();
|
||||
IsBreakTime.BindTo(player.IsBreakTime);
|
||||
}
|
||||
|
||||
public void ApplyToScoreProcessor(ScoreProcessor scoreProcessor)
|
||||
{
|
||||
if (HiddenComboCount.Value == 0) return;
|
||||
|
||||
CurrentCombo = scoreProcessor.Combo.GetBoundCopy();
|
||||
CurrentCombo.BindTo(scoreProcessor.Combo);
|
||||
CurrentCombo.BindValueChanged(combo =>
|
||||
{
|
||||
ComboBasedAlpha = Math.Max(MIN_ALPHA, 1 - (float)combo.NewValue / HiddenComboCount.Value);
|
||||
|
Reference in New Issue
Block a user