mirror of
https://github.com/ppy/osu.git
synced 2025-03-28 01:47:33 +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()
|
protected override void PrepareForUse()
|
||||||
{
|
{
|
||||||
base.PrepareForUse();
|
base.PrepareForUse();
|
||||||
|
@ -107,16 +107,7 @@ namespace osu.Game.Rulesets.Osu.UI
|
|||||||
if (!judgedObject.DisplayResult || !DisplayJudgements.Value)
|
if (!judgedObject.DisplayResult || !DisplayJudgements.Value)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var osuObject = (OsuHitObject)judgedObject.HitObject;
|
DrawableOsuJudgement explosion = poolDictionary[result.Type].Get(doj => doj.Apply(result, judgedObject));
|
||||||
|
|
||||||
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);
|
|
||||||
});
|
|
||||||
|
|
||||||
judgementLayer.Add(explosion);
|
judgementLayer.Add(explosion);
|
||||||
}
|
}
|
||||||
|
@ -75,7 +75,7 @@ namespace osu.Game.Rulesets.Judgements
|
|||||||
this.Delay(FadeOutDelay).FadeOut(400);
|
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;
|
Result = result;
|
||||||
JudgedObject = judgedObject;
|
JudgedObject = judgedObject;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user