Example #1
0
    void HandleManeuverExecution()
    {
        if (!activelyDraggingNode && Input.GetKeyDown(KeyCode.M)) 
        {
            SetManeuverNodeExecution(!executeManeuversBool);
        }

        float currentTrueAnomaly = ship.TrueAnomaly;
        for (int i = 0; i < plannedManeuvers.Count; i++)
        {
            ManeuverNode thisNode = plannedManeuvers[i];
            if (AngleInRange(thisNode.TrueAnomaly, lastTrueAnomalyCalculated, currentTrueAnomaly))
            {
                if (executeManeuversBool)
                {
                    ExecuteManeuver(thisNode);
                    return;
                }
                else
                {
                    thisNode.RecalculateIntersections();
                }
            }
        }
        lastTrueAnomalyCalculated = currentTrueAnomaly;
    }