public void CheckForWaypointEvent( IWaypointsFollower follower, float normalizedPositionOnCurve ) { while (true) { if (thisCurrentWaypontCurveEvents.Count != 0) { IWaypointEvent nextWaypontEvent = thisCurrentWaypontCurveEvents.Peek(); float eventPoint = nextWaypontEvent.GetEventPoint(); if (eventPoint <= normalizedPositionOnCurve) { if (eventPoint >= thisInitialEventPoint) { nextWaypontEvent = thisCurrentWaypontCurveEvents.Dequeue(); if (!nextWaypontEvent.IsExecuted()) { nextWaypontEvent.Execute(follower); } } } else { break; } } else { break; } } }
public int Compare(IWaypointEvent a, IWaypointEvent b) { return(a.GetEventPoint().CompareTo(b.GetEventPoint())); }