コード例 #1
0
 public void Pause()
 {
     Ignition.GetComponent <BoxCollider>().enabled  = false;
     GearStick.GetComponent <BoxCollider>().enabled = false;
     Time.timeScale = 0;
     PauseScreen.SetActive(true);
     Paused = true;
 }
コード例 #2
0
    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";
        }
    }
コード例 #3
0
    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);
            }
        }
    }