mirror of
https://github.com/osukey/osukey.git
synced 2025-06-23 12:18:03 +09:00
Change AdditiveTarget into a set method
This commit is contained in:
parent
fbe95a52e3
commit
19f39fe632
@ -42,25 +42,6 @@ namespace osu.Game.Rulesets.Catch.UI
|
|||||||
private Container<CatcherTrailSprite> hyperDashTrails;
|
private Container<CatcherTrailSprite> hyperDashTrails;
|
||||||
private Container<CatcherTrailSprite> endGlowSprites;
|
private Container<CatcherTrailSprite> 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<CatcherTrailSprite> { RelativeSizeAxes = Axes.Both, Colour = Color4.White },
|
|
||||||
hyperDashTrails ??= new Container<CatcherTrailSprite> { RelativeSizeAxes = Axes.Both, Colour = hyperDashColour },
|
|
||||||
endGlowSprites ??= new Container<CatcherTrailSprite> { RelativeSizeAxes = Axes.Both, Colour = hyperDashEndGlowColour },
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public CatcherAnimationState CurrentState { get; private set; }
|
public CatcherAnimationState CurrentState { get; private set; }
|
||||||
|
|
||||||
@ -167,6 +148,26 @@ namespace osu.Game.Rulesets.Catch.UI
|
|||||||
updateCatcher();
|
updateCatcher();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sets container target to provide catcher additive trails content in.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="target">The container to add catcher trails in.</param>
|
||||||
|
public void SetAdditiveTarget(Container target)
|
||||||
|
{
|
||||||
|
if (additiveTarget == target)
|
||||||
|
return;
|
||||||
|
|
||||||
|
additiveTarget?.RemoveRange(new[] { dashTrails, hyperDashTrails, endGlowSprites });
|
||||||
|
|
||||||
|
additiveTarget = target;
|
||||||
|
additiveTarget?.AddRange(new[]
|
||||||
|
{
|
||||||
|
dashTrails ??= new Container<CatcherTrailSprite> { RelativeSizeAxes = Axes.Both, Colour = Color4.White },
|
||||||
|
hyperDashTrails ??= new Container<CatcherTrailSprite> { RelativeSizeAxes = Axes.Both, Colour = hyperDashColour },
|
||||||
|
endGlowSprites ??= new Container<CatcherTrailSprite> { RelativeSizeAxes = Axes.Both, Colour = hyperDashEndGlowColour },
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Add a caught fruit to the catcher's stack.
|
/// Add a caught fruit to the catcher's stack.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -33,10 +33,9 @@ namespace osu.Game.Rulesets.Catch.UI
|
|||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X;
|
RelativeSizeAxes = Axes.X;
|
||||||
Height = CATCHER_SIZE;
|
Height = CATCHER_SIZE;
|
||||||
Child = MovableCatcher = new Catcher(difficulty);
|
|
||||||
|
|
||||||
// this property adds containers to 'this' so it must not be set in the object initializer.
|
Child = MovableCatcher = new Catcher(difficulty);
|
||||||
MovableCatcher.AdditiveTarget = this;
|
MovableCatcher.SetAdditiveTarget(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static float GetCatcherSize(BeatmapDifficulty difficulty)
|
public static float GetCatcherSize(BeatmapDifficulty difficulty)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user