Make SetInitialLifetime public

This commit is contained in:
ekrctb 2021-05-31 15:33:28 +09:00
parent 771f3c48c0
commit 56a0a24cba
1 changed files with 3 additions and 3 deletions

View File

@ -35,11 +35,11 @@ public HitObjectLifetimeEntry(HitObject hitObject)
HitObject = hitObject;
startTimeBindable.BindTo(HitObject.StartTimeBindable);
startTimeBindable.BindValueChanged(_ => setInitialLifetime(), true);
startTimeBindable.BindValueChanged(_ => SetInitialLifetime(), true);
// Subscribe to this event before the DrawableHitObject so that the local callback is invoked before the entry is re-applied as a result of DefaultsApplied.
// This way, the DrawableHitObject can use OnApply() to overwrite the LifetimeStart that was set inside setInitialLifetime().
HitObject.DefaultsApplied += _ => setInitialLifetime();
HitObject.DefaultsApplied += _ => SetInitialLifetime();
}
// The lifetime, as set by the hitobject.
@ -94,6 +94,6 @@ internal bool KeepAlive
/// <summary>
/// Set <see cref="LifetimeEntry.LifetimeStart"/> using <see cref="InitialLifetimeOffset"/>.
/// </summary>
private void setInitialLifetime() => LifetimeStart = HitObject.StartTime - InitialLifetimeOffset;
public void SetInitialLifetime() => LifetimeStart = HitObject.StartTime - InitialLifetimeOffset;
}
}