mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 00:40:09 +09:00
Avoid internal
property by using ChildrenOfType
This commit is contained in:
@ -130,7 +130,7 @@ namespace osu.Game.Rulesets.Catch.Tests
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, skin);
|
}, skin);
|
||||||
trails = catcherArea.CatcherTrails;
|
trails = catcherArea.ChildrenOfType<CatcherTrailDisplay>().Single();
|
||||||
});
|
});
|
||||||
|
|
||||||
AddStep("start hyper-dash", () =>
|
AddStep("start hyper-dash", () =>
|
||||||
|
@ -28,12 +28,12 @@ namespace osu.Game.Rulesets.Catch.UI
|
|||||||
set => catcherContainer.Child = catcher = value;
|
set => catcherContainer.Child = catcher = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal CatcherTrailDisplay CatcherTrails { get; }
|
|
||||||
|
|
||||||
private readonly Container<Catcher> catcherContainer;
|
private readonly Container<Catcher> catcherContainer;
|
||||||
|
|
||||||
private readonly CatchComboDisplay comboDisplay;
|
private readonly CatchComboDisplay comboDisplay;
|
||||||
|
|
||||||
|
private readonly CatcherTrailDisplay catcherTrails;
|
||||||
|
|
||||||
private Catcher catcher;
|
private Catcher catcher;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -55,7 +55,7 @@ namespace osu.Game.Rulesets.Catch.UI
|
|||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
catcherContainer = new Container<Catcher> { RelativeSizeAxes = Axes.Both },
|
catcherContainer = new Container<Catcher> { RelativeSizeAxes = Axes.Both },
|
||||||
CatcherTrails = new CatcherTrailDisplay(),
|
catcherTrails = new CatcherTrailDisplay(),
|
||||||
comboDisplay = new CatchComboDisplay
|
comboDisplay = new CatchComboDisplay
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.None,
|
RelativeSizeAxes = Axes.None,
|
||||||
@ -110,14 +110,14 @@ namespace osu.Game.Rulesets.Catch.UI
|
|||||||
comboDisplay.X = Catcher.X;
|
comboDisplay.X = Catcher.X;
|
||||||
|
|
||||||
if (!lastHyperDashState && Catcher.HyperDashing && Time.Elapsed > 0)
|
if (!lastHyperDashState && Catcher.HyperDashing && Time.Elapsed > 0)
|
||||||
CatcherTrails.DisplayEndGlow(Catcher.CurrentState, Catcher.X, Catcher.BodyScale);
|
catcherTrails.DisplayEndGlow(Catcher.CurrentState, Catcher.X, Catcher.BodyScale);
|
||||||
|
|
||||||
if (Catcher.Dashing || Catcher.HyperDashing)
|
if (Catcher.Dashing || Catcher.HyperDashing)
|
||||||
{
|
{
|
||||||
double generationInterval = Catcher.HyperDashing ? 25 : 50;
|
double generationInterval = Catcher.HyperDashing ? 25 : 50;
|
||||||
|
|
||||||
if (Time.Current - CatcherTrails.LastDashTrailTime >= generationInterval)
|
if (Time.Current - catcherTrails.LastDashTrailTime >= generationInterval)
|
||||||
CatcherTrails.DisplayDashTrail(Catcher.CurrentState, Catcher.X, Catcher.BodyScale, Catcher.HyperDashing);
|
catcherTrails.DisplayDashTrail(Catcher.CurrentState, Catcher.X, Catcher.BodyScale, Catcher.HyperDashing);
|
||||||
}
|
}
|
||||||
|
|
||||||
lastHyperDashState = Catcher.HyperDashing;
|
lastHyperDashState = Catcher.HyperDashing;
|
||||||
|
Reference in New Issue
Block a user