protected override void OnChildLifetimeBoundaryCrossed(LifetimeBoundaryCrossedEvent e) { if (e.Kind == LifetimeBoundaryKind.End && e.Direction == LifetimeBoundaryCrossingDirection.Forward && e.Child is DrawableHitObject hitObject) { hitObject.OnLifetimeEnd(); } }
protected override void OnChildLifetimeBoundaryCrossed(LifetimeBoundaryCrossedEvent e) { base.OnChildLifetimeBoundaryCrossed(e); // ensure all old hits are removed on becoming alive (may miss being in the AliveInternalChildren list above). if (e.Kind == LifetimeBoundaryKind.Start && e.Direction == LifetimeBoundaryCrossingDirection.Backward) { Remove((DrawableHitObject)e.Child); } }
protected override void OnChildLifetimeBoundaryCrossed(LifetimeBoundaryCrossedEvent e) { // Recalculate path if appear if (e.Kind == LifetimeBoundaryKind.Start && e.Child is SaitenPath path) { computePath(path); } base.OnChildLifetimeBoundaryCrossed(e); }
protected override void OnChildLifetimeBoundaryCrossed(LifetimeBoundaryCrossedEvent e) { if (!(e.Child is DrawableHitObject hitObject)) { return; } if ((e.Kind == LifetimeBoundaryKind.End && e.Direction == LifetimeBoundaryCrossingDirection.Forward) || (e.Kind == LifetimeBoundaryKind.Start && e.Direction == LifetimeBoundaryCrossingDirection.Backward)) { hitObject.OnKilled(); } }
protected override void OnChildLifetimeBoundaryCrossed(LifetimeBoundaryCrossedEvent e) { if (e.Child is TestChild c) { c.Crossings.Add(e); int d = e.Direction == LifetimeBoundaryCrossingDirection.Forward ? 1 : -1; if (e.Kind == LifetimeBoundaryKind.Start) { c.StartDelta += d; } else { c.EndDelta += d; } Assert.IsTrue(Math.Abs(c.StartDelta) <= 1 && Math.Abs(c.EndDelta) <= 1); } OnCrossing?.Invoke(e); }