Run RecreatePieces using AddOnce to avoid multiple unnecessary calls

This commit is contained in:
Dean Herbert
2021-05-21 16:45:28 +09:00
parent 0bcd0cda6b
commit 6471ce902d
2 changed files with 2 additions and 2 deletions

View File

@ -53,7 +53,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
{ {
type.BindTo(HitObject.TypeBindable); type.BindTo(HitObject.TypeBindable);
// this doesn't need to be run inline as RecreatePieces is called by the base call below. // this doesn't need to be run inline as RecreatePieces is called by the base call below.
type.BindValueChanged(_ => RecreatePieces()); type.BindValueChanged(_ => Scheduler.AddOnce(RecreatePieces));
base.OnApply(); base.OnApply();
} }

View File

@ -28,7 +28,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
{ {
isStrong.BindTo(HitObject.IsStrongBindable); isStrong.BindTo(HitObject.IsStrongBindable);
// this doesn't need to be run inline as RecreatePieces is called by the base call below. // this doesn't need to be run inline as RecreatePieces is called by the base call below.
isStrong.BindValueChanged(_ => RecreatePieces()); isStrong.BindValueChanged(_ => Scheduler.AddOnce(RecreatePieces));
base.OnApply(); base.OnApply();
} }