mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 14:52:57 +08:00
Fix lifetime performance regression.
This commit is contained in:
parent
b1d25ed388
commit
e1dfe364b2
@ -22,20 +22,22 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private double? lifetimeStart;
|
||||||
public override double LifetimeStart
|
public override double LifetimeStart
|
||||||
{
|
{
|
||||||
get { return Math.Min(HitObject.StartTime - LifetimeOffset, base.LifetimeStart); }
|
get { return lifetimeStart ?? HitObject.StartTime - LifetimeOffset; }
|
||||||
set { base.LifetimeStart = value; }
|
set { lifetimeStart = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private double? lifetimeEnd;
|
||||||
public override double LifetimeEnd
|
public override double LifetimeEnd
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
var endTime = (HitObject as IHasEndTime)?.EndTime ?? HitObject.StartTime;
|
var endTime = (HitObject as IHasEndTime)?.EndTime ?? HitObject.StartTime;
|
||||||
return Math.Max(endTime + LifetimeOffset, base.LifetimeEnd);
|
return lifetimeEnd ?? endTime + LifetimeOffset;
|
||||||
}
|
}
|
||||||
set { base.LifetimeEnd = value; }
|
set { lifetimeEnd = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void AddNested(DrawableHitObject<TObject, TJudgement> h)
|
protected override void AddNested(DrawableHitObject<TObject, TJudgement> h)
|
||||||
|
Loading…
Reference in New Issue
Block a user