mirror of
https://github.com/ppy/osu.git
synced 2025-03-22 22:17:46 +08:00
Make Apply virtual to further simplify application process
This commit is contained in:
parent
8aff828dfe
commit
f872343bab
@ -43,6 +43,17 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
}
|
||||
}
|
||||
|
||||
public override void Apply(JudgementResult result, DrawableHitObject judgedObject)
|
||||
{
|
||||
base.Apply(result, judgedObject);
|
||||
|
||||
if (judgedObject?.HitObject is OsuHitObject osuObject)
|
||||
{
|
||||
Position = osuObject.StackedPosition;
|
||||
Scale = new Vector2(osuObject.Scale);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void PrepareForUse()
|
||||
{
|
||||
base.PrepareForUse();
|
||||
|
@ -107,16 +107,7 @@ namespace osu.Game.Rulesets.Osu.UI
|
||||
if (!judgedObject.DisplayResult || !DisplayJudgements.Value)
|
||||
return;
|
||||
|
||||
var osuObject = (OsuHitObject)judgedObject.HitObject;
|
||||
|
||||
DrawableOsuJudgement explosion = poolDictionary[result.Type].Get(doj =>
|
||||
{
|
||||
doj.Apply(result, judgedObject);
|
||||
|
||||
// todo: move to JudgedObject property?
|
||||
doj.Position = osuObject.StackedEndPosition;
|
||||
doj.Scale = new Vector2(osuObject.Scale);
|
||||
});
|
||||
DrawableOsuJudgement explosion = poolDictionary[result.Type].Get(doj => doj.Apply(result, judgedObject));
|
||||
|
||||
judgementLayer.Add(explosion);
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ namespace osu.Game.Rulesets.Judgements
|
||||
this.Delay(FadeOutDelay).FadeOut(400);
|
||||
}
|
||||
|
||||
public void Apply([NotNull] JudgementResult result, [CanBeNull] DrawableHitObject judgedObject)
|
||||
public virtual void Apply([NotNull] JudgementResult result, [CanBeNull] DrawableHitObject judgedObject)
|
||||
{
|
||||
Result = result;
|
||||
JudgedObject = judgedObject;
|
||||
|
Loading…
x
Reference in New Issue
Block a user