public void UpdateETAClock() { string timeText; float stasisTimeMultiplier; if (activeJob != null) { if (isInStasis) { stasisTimeMultiplier = 1000000; blackScreen.SetAlpha(1f); Debug.Log("in stasis"); } else { Debug.Log("Not in stasis"); stasisTimeMultiplier = 1; } currentDist = currentDist /*LS*/ - (ship.previousFrameShipSpeed /*LSPS*/ * (Time.deltaTime /*S*/ * stasisTimeMultiplier)); eta /*S*/ = currentDist /*LS*/ / ship.previousFrameShipSpeed /*LSPS*/; Debug.Log(currentDist); Debug.Log(eta); TimeSpan timeSpan = TimeSpan.FromSeconds(eta); timeText = string.Format("{0:D3}:{1:D2}:{2:D2}:{3:D2}", timeSpan.Days, timeSpan.Hours, timeSpan.Minutes, timeSpan.Seconds); if (eta < 0) { activeJob.jobComplete = true; ship.UpdateCurrency(activeJob.cargoValue); timeText = "Job Complete"; jobsCompleted++; activeJob = null; isInStasis = false; blackScreen.SetAlpha(0f); } } else { timeText = "No Destination Selected"; } etaClock.WriteToMonitor(timeText); }
private void OnTriggerEnter(Collider other) { blackScreen.SetAlpha(1); endScreen.enabled = true; }