mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Introduce IHasCatchObjectState implemented by DHO and CaughtObject
This commit is contained in:
@ -7,7 +7,6 @@ using osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Rulesets.Catch.Objects.Drawables;
|
||||
using osu.Game.Rulesets.Objects.Drawables;
|
||||
using osuTK.Graphics;
|
||||
|
||||
namespace osu.Game.Rulesets.Catch.Skinning.Default
|
||||
@ -17,13 +16,8 @@ namespace osu.Game.Rulesets.Catch.Skinning.Default
|
||||
public readonly Bindable<Color4> AccentColour = new Bindable<Color4>();
|
||||
public readonly Bindable<bool> HyperDash = new Bindable<bool>();
|
||||
|
||||
[Resolved(canBeNull: true)]
|
||||
[CanBeNull]
|
||||
protected DrawableHitObject DrawableHitObject { get; private set; }
|
||||
|
||||
[Resolved(canBeNull: true)]
|
||||
[CanBeNull]
|
||||
protected CaughtObject CaughtObject { get; private set; }
|
||||
[Resolved]
|
||||
protected IHasCatchObjectState ObjectState { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// A part of this piece that will be faded out while falling in the playfield.
|
||||
@ -41,16 +35,8 @@ namespace osu.Game.Rulesets.Catch.Skinning.Default
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
var hitObject = (DrawablePalpableCatchHitObject)DrawableHitObject;
|
||||
|
||||
if (hitObject != null)
|
||||
{
|
||||
AccentColour.BindTo(hitObject.AccentColour);
|
||||
HyperDash.BindTo(hitObject.HyperDash);
|
||||
}
|
||||
|
||||
if (CaughtObject != null)
|
||||
AccentColour.BindTo(CaughtObject.AccentColour);
|
||||
AccentColour.BindTo(ObjectState.AccentColour);
|
||||
HyperDash.BindTo(ObjectState.HyperDash);
|
||||
|
||||
HyperDash.BindValueChanged(hyper =>
|
||||
{
|
||||
@ -61,13 +47,8 @@ namespace osu.Game.Rulesets.Catch.Skinning.Default
|
||||
|
||||
protected override void Update()
|
||||
{
|
||||
if (BorderPiece != null)
|
||||
{
|
||||
if (DrawableHitObject?.HitObject != null)
|
||||
BorderPiece.Alpha = (float)Math.Clamp((DrawableHitObject.HitObject.StartTime - Time.Current) / 500, 0, 1);
|
||||
else
|
||||
BorderPiece.Alpha = 0;
|
||||
}
|
||||
if (BorderPiece != null && ObjectState?.HitObject != null)
|
||||
BorderPiece.Alpha = (float)Math.Clamp((ObjectState.HitObject.StartTime - Time.Current) / 500, 0, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user