diff --git a/osu.Game.Rulesets.Catch/UI/Catcher.cs b/osu.Game.Rulesets.Catch/UI/Catcher.cs index 1cb6987397..0e42c19455 100644 --- a/osu.Game.Rulesets.Catch/UI/Catcher.cs +++ b/osu.Game.Rulesets.Catch/UI/Catcher.cs @@ -42,25 +42,6 @@ namespace osu.Game.Rulesets.Catch.UI private Container hyperDashTrails; private Container endGlowSprites; - public Container AdditiveTarget - { - get => additiveTarget; - set - { - if (additiveTarget == value) - return; - - additiveTarget?.RemoveRange(new[] { dashTrails, hyperDashTrails, endGlowSprites }); - - additiveTarget = value; - additiveTarget?.AddRange(new[] - { - dashTrails ??= new Container { RelativeSizeAxes = Axes.Both, Colour = Color4.White }, - hyperDashTrails ??= new Container { RelativeSizeAxes = Axes.Both, Colour = hyperDashColour }, - endGlowSprites ??= new Container { RelativeSizeAxes = Axes.Both, Colour = hyperDashEndGlowColour }, - }); - } - } public CatcherAnimationState CurrentState { get; private set; } @@ -167,6 +148,26 @@ namespace osu.Game.Rulesets.Catch.UI updateCatcher(); } + /// + /// Sets container target to provide catcher additive trails content in. + /// + /// The container to add catcher trails in. + public void SetAdditiveTarget(Container target) + { + if (additiveTarget == target) + return; + + additiveTarget?.RemoveRange(new[] { dashTrails, hyperDashTrails, endGlowSprites }); + + additiveTarget = target; + additiveTarget?.AddRange(new[] + { + dashTrails ??= new Container { RelativeSizeAxes = Axes.Both, Colour = Color4.White }, + hyperDashTrails ??= new Container { RelativeSizeAxes = Axes.Both, Colour = hyperDashColour }, + endGlowSprites ??= new Container { RelativeSizeAxes = Axes.Both, Colour = hyperDashEndGlowColour }, + }); + } + /// /// Add a caught fruit to the catcher's stack. /// diff --git a/osu.Game.Rulesets.Catch/UI/CatcherArea.cs b/osu.Game.Rulesets.Catch/UI/CatcherArea.cs index 37501736ff..641b81599e 100644 --- a/osu.Game.Rulesets.Catch/UI/CatcherArea.cs +++ b/osu.Game.Rulesets.Catch/UI/CatcherArea.cs @@ -33,10 +33,9 @@ namespace osu.Game.Rulesets.Catch.UI { RelativeSizeAxes = Axes.X; Height = CATCHER_SIZE; - Child = MovableCatcher = new Catcher(difficulty); - // this property adds containers to 'this' so it must not be set in the object initializer. - MovableCatcher.AdditiveTarget = this; + Child = MovableCatcher = new Catcher(difficulty); + MovableCatcher.SetAdditiveTarget(this); } public static float GetCatcherSize(BeatmapDifficulty difficulty)