Inheritance: UnityEngine.MonoBehaviour
 internal Trajectory(Vessel vessel)
 {
     AttachedVessel = vessel;
     TargetProfile  = new TargetProfile(this);
     DescentProfile = new DescentProfile(this);
     FlightOverlay  = new FlightOverlay(this);
     MapOverlay     = new MapOverlay(this);
     NavBallOverlay = new NavBallOverlay(this);
     Util.DebugLog("Constructing");
 }
 internal void OnDestroy()
 {
     Util.DebugLog("");
     AttachedVessel = null;
     AppLauncherButton.DestroyToolbarButton();
     MainGUI.DeSpawn();
     NavBallOverlay.DestroyTransforms();
     FlightOverlay.Destroy();
     MapOverlay.DestroyRenderer();
     Trajectory.Destroy();
     DescentProfile.Clear();
 }
 internal void OnApplicationQuit()
 {
     Util.Log("Ending after {0} seconds", Time.time);
     AttachedVessel = null;
     AppLauncherButton.Destroy();
     MainGUI.Destroy();
     NavBallOverlay.Destroy();
     FlightOverlay.Destroy();
     MapOverlay.Destroy();
     Trajectory.Destroy();
     DescentProfile.Destroy();
     if (Settings != null)
     {
         Settings.Destroy();
     }
     Settings = null;
 }
Exemple #4
0
        /*public override void OnSave(ConfigNode node)
         * {
         *  if (node == null)
         *      return;
         *
         *  Util.DebugLog("Node: {0}", node.name);
         *
         *  //node.AddValue("version", Version);                       // save version
         * }*/

        internal void Update()
        {
            if (Util.IsPaused || Settings == null || !Util.IsFlight)
            {
                return;
            }

            if (AttachedVessel != FlightGlobals.ActiveVessel)
            {
                AttachVessel();
            }

            Trajectory.Update();
            MapOverlay.Update();
            FlightOverlay.Update();
            NavBallOverlay.Update();
            MainGUI.Update();
        }
        /*public override void OnSave(ConfigNode node)
         * {
         *  if (node == null)
         *      return;
         *
         *  Util.DebugLog("Node: {0}", node.name);
         *
         *  //node.AddValue("version", Version);                       // save version
         * }*/

        internal void Update()
        {
            if (Util.IsPaused || Settings == null || !Util.IsFlight)
            {
                return;
            }

            if (AttachedVessel != FlightGlobals.ActiveVessel)
            {
                AttachVessel();
            }

            Trajectory.Update();
            MapOverlay.Update();
            FlightOverlay.Update();
            NavBallOverlay.Update();
            MainGUI.Update();
            if (!Settings.NewGui)
#pragma warning disable CS0618 // Type or member is obsolete
            {
                OldGUI.Update();
            }
#pragma warning restore CS0618 // Type or member is obsolete
        }
Exemple #6
0
 public static Tuple <float, float, float> CorrectedDirection()
 {
     if (FlightGlobals.ActiveVessel != null && Trajectory.Target.Body != null)
     {
         return(new Tuple <float, float, float>(NavBallOverlay.GetCorrectedDirection().x, NavBallOverlay.GetCorrectedDirection().y, NavBallOverlay.GetCorrectedDirection().z));
     }
     return(new Tuple <float, float, float>(0, 0, 0));
 }
Exemple #7
0
 public static Vector3 correctedDirection()
 {
     return(NavBallOverlay.GetCorrectedDirection());
 }
Exemple #8
0
 public static Vector3 plannedDirection()
 {
     return(NavBallOverlay.GetPlannedDirection());
 }