コード例 #1
0
 private void OnEditorShipModified(ShipConstruct ship = null)
 {
     if (!EngineerIsPinned)
     {
         notPinnedShipModified = true;
         Log("notPinned but ShipModified", "QEditor");
         return;
     }
     if (QSettings.Instance.AllVesselEngineer_Disable)
     {
         Log("VesselEngineer is disabled", "QEditor");
         return;
     }
     if (EditorIsActive)
     {
         if (QStage.stagesCount <= 0)
         {
             Log("No stage inited ... waiting.", "QEditor");
             return;
         }
         notPinnedShipModified = false;
         Log("Start a simulation", "QEditor");
         if (QSettings.Instance.EditorVesselEngineer_Simple)
         {
             QVessel.Init(new QStage());
             QVessel.StartSim();
         }
         else
         {
             if (calculation != null)
             {
                 QVessel.calculationToRestart = true;
                 Log("Restart the calculations", "QEditor");
             }
             else
             {
                 calculation = StartCoroutine(QVessel.calcWithATM());
             }
         }
     }
     else
     {
         UpdateEngineer("Vessel");
     }
     Log("OnEditorShipModified", "QEditor");
 }
コード例 #2
0
 private void Update()
 {
     if (!QStockToolbar.isActive)
     {
         return;
     }
     if (appIsLive)
     {
         Vessel _vessel = FlightGlobals.ActiveVessel;
         if (_vessel != null)
         {
             if (TimeWarp.WarpMode == TimeWarp.Modes.LOW || TimeWarp.CurrentRate <= TimeWarp.MaxPhysicsRate)
             {
                 QStage _qStage = new QStage(_vessel.mainBody, _vessel.atmDensity != 0d, _vessel.mach, (float)_vessel.altitude);
                 QVessel.Init(_qStage);
                 QVessel.StartSim();
             }
         }
     }
 }