public void Pause() { Ignition.GetComponent <BoxCollider>().enabled = false; GearStick.GetComponent <BoxCollider>().enabled = false; Time.timeScale = 0; PauseScreen.SetActive(true); Paused = true; }
public void ActivateShip() { HudElements.SetActive(true); ShipRunning = true; Ignition.GetComponent <BoxCollider>().enabled = false; GearScript.GearText.text = "Gear: " + GearScript.CurrentGear; if (GearScript.CurrentGear == 0) { GearScript.GearText.text = "Gear: N"; } }
void Update() { IgnitionLeverValue = IgnitionLever.GetComponent <LinearMapping>().value; if (!RightHand.ObjectIsAttached(RightThrottle)) { Ignition.GetComponent <BoxCollider>().enabled = true; } if (ShipRunning && IgnitionLeverValue > 0) { Ignition.GetComponent <Interactable>().enabled = false; } else { Ignition.GetComponent <Interactable>().enabled = true; } if (PauseBtn.GetStateDown(LeftHand.handType)) { if (!Paused && !Dead) { Pause(); } else if (Paused && !Dead) { UnPause(); } } if (RestartBtn.GetStateDown(RightHand.handType)) { if (Paused || Dead) { SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex); } } }