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"); }
void OnFlightReady() { PauseMenu.Display(); QLoading.Ended = true; QuickStart.Log("Not need to keep it loaded.", "QFlight"); Destroy(this); return; }
void OnDestroy() { GameEvents.onFlightReady.Remove(OnFlightReady); QuickStart.Log("OnDestroy", "QFlight"); }
void Start() { QuickStart.Log("Start", "QFlight"); }