1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-27 20:22:56 +08:00
osu-lazer/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/ReverseArrowPiece.cs

51 lines
1.6 KiB
C#
Raw Normal View History

// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Audio.Track;
using osu.Framework.Graphics;
using osuTK;
using osu.Framework.Graphics.Sprites;
using osu.Game.Beatmaps.ControlPoints;
using osu.Game.Graphics.Containers;
using osu.Game.Skinning;
2020-04-05 18:36:52 +08:00
using osu.Framework.Allocation;
using osu.Game.Rulesets.Objects.Drawables;
namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
{
public class ReverseArrowPiece : BeatSyncedContainer
{
2020-04-05 18:36:52 +08:00
[Resolved]
2020-04-05 18:39:31 +08:00
private DrawableHitObject drawableRepeat { get; set; }
2020-04-05 17:45:10 +08:00
2020-01-14 17:14:31 +08:00
public ReverseArrowPiece()
{
Divisor = 2;
MinimumBeatLength = 200;
Anchor = Anchor.Centre;
Origin = Anchor.Centre;
Size = new Vector2(OsuHitObject.OBJECT_RADIUS * 2);
2020-01-14 00:45:10 +08:00
Child = new SkinnableDrawable(new OsuSkinComponent(OsuSkinComponents.ReverseArrow), _ => new SpriteIcon
{
RelativeSizeAxes = Axes.Both,
2020-04-08 17:58:09 +08:00
Blending = BlendingParameters.Additive,
Icon = FontAwesome.Solid.ChevronRight,
Size = new Vector2(0.35f)
2020-01-14 00:45:32 +08:00
})
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
};
}
2020-04-05 17:45:10 +08:00
protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, TrackAmplitudes amplitudes)
{
2020-04-05 18:39:31 +08:00
if (!drawableRepeat.IsHit)
2020-04-05 17:45:10 +08:00
Child.ScaleTo(1.3f).ScaleTo(1f, timingPoint.BeatLength, Easing.Out);
}
}
}