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");
 }
示例#2
0
 internal void OnDestroy()
 {
     Util.DebugLog("");
     AttachedVessel = null;
     AppLauncherButton.DestroyToolbarButton();
     MainGUI.DeSpawn();
     NavBallOverlay.DestroyTransforms();
     FlightOverlay.Destroy();
     MapOverlay.DestroyRenderer();
     Trajectory.Destroy();
     DescentProfile.Clear();
 }
示例#3
0
 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;
 }
示例#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();
        }
示例#5
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();
            if (!Settings.NewGui)
#pragma warning disable CS0618 // Type or member is obsolete
            {
                OldGUI.Update();
            }
#pragma warning restore CS0618 // Type or member is obsolete
        }
示例#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));
 }
示例#7
0
 public static Vector3 correctedDirection()
 {
     return(NavBallOverlay.GetCorrectedDirection());
 }
示例#8
0
 public static Vector3 plannedDirection()
 {
     return(NavBallOverlay.GetPlannedDirection());
 }