public void ExecuteWaypointEventsUpTo( IWaypointsFollower follower, float eventPoint ) { foreach (IWaypointEvent wpEvent in thisCurrentCurve.GetWaypointEvents()) { if (wpEvent.GetEventPoint() < eventPoint) { wpEvent.Execute(follower); } } }
public void SetNewCurve(IWaypointCurve curve) { thisInitialEventPoint = 0f; thisCurrentCurve = curve; IWaypointEvent[] list = thisCurrentCurve.GetWaypointEvents(); Queue <IWaypointEvent> result = new Queue <IWaypointEvent>(); foreach (IWaypointEvent waypointEvent in list) { result.Enqueue(waypointEvent); waypointEvent.Reset(); } thisCurrentWaypontCurveEvents = result; }
void DrawWaypointEvents(Rect rect) { if (thisGameIsReady) { string result = ""; IWaypointsFollower follower = waypointsFollowerAdaptor.GetWaypointsFollower(); float normalizedPosOnCurve = follower.GetNormalizedPositionInCurve(); result += "normPos: " + normalizedPosOnCurve.ToString("N2") + "\n"; IWaypointCurveCycleManager curveManager = curveCycleManagerAdaptor.GetWaypointsManager(); int currentCurveIndex = gameManager.GetCurrentWaypointGroupIndex(); IWaypointCurve currentCurve = curveManager.GetAllWaypointCurves()[currentCurveIndex]; IWaypointEvent[] evnets = currentCurve.GetWaypointEvents(); result += "curve id: " + currentCurve.GetIndex().ToString() + "\n"; // foreach(IWaypointEvent wpEvent in evnets){ // string thisEventString = "\n"; // thisEventString += wpEvent.GetName() + ": " + wpEvent.GetEventPoint().ToString("N2"); // TargetType thisType = TargetType.Flyer; // bool isRare = false; // if(wpEvent is IShootingTargetSpawnWaypointEvent){ // IShootingTargetSpawnWaypointEvent spawnEvent = (IShootingTargetSpawnWaypointEvent)wpEvent; // isRare = spawnEvent.IsRare(); // thisType = spawnEvent.GetTargetType(); // IShootingTargetSpawnPoint spawnPoint = spawnEvent.GetSpawnPoint(); // thisEventString += ", sp: " + spawnPoint.GetName(); // IShootingTarget target = spawnPoint.GetSpawnedTarget(); // if(target != null) // thisEventString += ", tar: " + target.GetName(); // else // thisEventString += ", tar: null"; // } // Color col = GetStringColorForType(thisType, isRare); // thisEventString = DKUtility.DebugHelper.StringInColor(thisEventString, col); // result += thisEventString; // string executedString = ", "; // if(!wpEvent.IsExecuted()) // executedString += "pending"; // else // executedString += DKUtility.DebugHelper.RedString("executed"); // result += executedString; // } GUI.Label( rect, result ); } }