Ejemplo n.º 1
0
 void Awake()
 {
     if (QLoading.Ended)
     {
         QuickStart.Warning("Reload? Destroy.", "QLoading");
         Destroy(this);
         return;
     }
     if (!QSettings.Instance.enablePauseOnFlight || !QSettings.Instance.Enabled || QSettings.Instance.gameScene != (int)GameScenes.FLIGHT)
     {
         QuickStart.Log("Not need to keep it loaded.", "QFlight");
         QLoading.Ended = true;
         Destroy(this);
         return;
     }
     if (Instance != null)
     {
         QuickStart.Warning("There's already an Instance", "QFlight");
         Destroy(this);
         return;
     }
     Instance = this;
     GameEvents.onFlightReady.Add(OnFlightReady);
     QuickStart.Log("Awake", "QFlight");
 }
Ejemplo n.º 2
0
 protected override void Awake()
 {
     if (!HighLogic.LoadedSceneIsFlight)
     {
         Warning("QFlight needs to be load only on flight.", "QFlight");
         Destroy(this);
         return;
     }
     if (Instance != null)
     {
         Warning("There's already an Instance", "QFlight");
         Destroy(this);
         return;
     }
     Instance = this;
     if (QSettings.Instance.EnableRevertKeep)
     {
         GameEvents.onFlightReady.Add(OnFlightReady);
     }
     if (QSettings.Instance.EnableRevertLoss)
     {
         if (Planetarium.fetch.Home.atmosphere)
         {
             GameEvents.VesselSituation.onReachSpace.Add(OnReachSpace);
         }
         else
         {
             GameEvents.VesselSituation.onEscape.Add(OnEscape);
         }
     }
     Log("Awake", "QFlight");
 }