1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 22:47:25 +08:00
osu-lazer/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/KiaiFlash.cs

43 lines
1.4 KiB
C#
Raw Normal View History

2019-12-21 20:47:34 +08:00
// 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.Graphics;
using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
{
public class KiaiFlash : BeatSyncedContainer
{
public Drawable FlashComponent { get; set; }
2019-12-21 20:53:02 +08:00
public float Intensity { get; set; }
2019-12-21 20:47:34 +08:00
public KiaiFlash()
{
Blending = BlendingParameters.Additive;
Child = FlashComponent = new Box
{
RelativeSizeAxes = Axes.Both,
Colour = OsuColour.Gray(1f),
Alpha = 0f,
};
}
protected new double EarlyActivationMilliseconds = 80;
protected override void OnNewBeat(int beatIndex, Game.Beatmaps.ControlPoints.TimingControlPoint timingPoint, Game.Beatmaps.ControlPoints.EffectControlPoint effectPoint, Framework.Audio.Track.TrackAmplitudes amplitudes)
{
if (effectPoint.KiaiMode)
{
FlashComponent
2019-12-21 20:53:02 +08:00
.FadeTo(Intensity, EarlyActivationMilliseconds, Easing.OutQuint)
2019-12-21 20:47:34 +08:00
.Then()
.FadeOut(timingPoint.BeatLength - 80, Easing.OutSine);
}
}
}
}