1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-24 06:07:25 +08:00
osu-lazer/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs

67 lines
1.9 KiB
C#
Raw Normal View History

// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.ComponentModel;
2017-04-18 15:05:58 +08:00
using osu.Game.Rulesets.Objects.Drawables;
using osu.Framework.Graphics;
using System.Linq;
2017-04-18 15:05:58 +08:00
namespace osu.Game.Rulesets.Osu.Objects.Drawables
{
2017-09-06 17:05:51 +08:00
public class DrawableOsuHitObject : DrawableHitObject<OsuHitObject>
{
public const float TIME_PREEMPT = 600;
public const float TIME_FADEIN = 400;
public const float TIME_FADEOUT = 500;
protected DrawableOsuHitObject(OsuHitObject hitObject)
: base(hitObject)
{
AccentColour = HitObject.ComboColour;
Alpha = 0;
}
2017-04-28 12:27:20 +08:00
protected sealed override void UpdateState(ArmedState state)
{
2017-07-21 23:24:09 +08:00
FinishTransforms();
using (BeginAbsoluteSequence(HitObject.StartTime - TIME_PREEMPT, true))
{
UpdateInitialState();
UpdatePreemptState();
2017-09-12 17:26:56 +08:00
using (BeginDelayedSequence(TIME_PREEMPT + (Judgements.FirstOrDefault()?.TimeOffset ?? 0), true))
UpdateCurrentState(state);
}
}
protected virtual void UpdateInitialState()
{
Hide();
}
protected virtual void UpdatePreemptState()
{
this.FadeIn(TIME_FADEIN);
}
protected virtual void UpdateCurrentState(ArmedState state)
{
}
private OsuInputManager osuActionInputManager;
internal OsuInputManager OsuActionInputManager => osuActionInputManager ?? (osuActionInputManager = GetContainingInputManager() as OsuInputManager);
}
public enum ComboResult
{
[Description(@"")]
None,
[Description(@"Good")]
Good,
[Description(@"Amazing")]
Perfect
}
}