///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



    void LateUpdate()
    {
        //--------------

        if (Class_Controller.playerAlive == true)
        {
            if (Class_Interface.loading == false)
            {
                if (Input.GetKeyDown(KeyCode.Q))
                {
                    if (inventoryScreen.activeSelf == false)
                    {
                        EntranceToInventory();
                    }
                    else
                    {
                        ReturnToGame();
                    }
                }
                if (loadingRing.activeSelf == true)
                {
                    loadingRing.SetActive(false);
                }
            }
            else if (loadingRing.activeSelf == false)
            {
                loadingRing.SetActive(true);
            }

            if (Class_Controller.currentSpeed >= 1)
            {
                if (Class_Interface.speedEnabled == true)
                {
                    if (speedIndicator != 1.3f)
                    {
                        speedIndicator = 1.3f;
                    }
                }
                else
                {
                    if (speedIndicator > 1.08f)
                    {
                        speedIndicator -= 0.007f;
                    }
                    else if (speedIndicator <= 1.08f)
                    {
                        speedIndicator = 1.08f;
                    }
                }
                speedIndicatorTransform.localScale = new Vector3(Vector3.one.x * Class_Controller.currentSpeed * 0.016f, Vector3.one.y, Vector3.one.z);
                if (speedIndicatorTransform.localScale.x > speedIndicator)
                {
                    speedIndicatorTransform.localScale = new Vector3(speedIndicator, Vector3.one.y, Vector3.one.z);
                }
            }

            Inventory();
        }
        else if (playerIsDeadScreen.activeSelf == false)
        {
            PlayerPrefs.SetInt("Mineral 0", 0);
            playerIsDeadScreen.SetActive(true);
        }

        //--------------

        if (pause == false)
        {
            Class_Interface.HideLockMouse(hideLockMouse);
        }
        else
        {
            Class_Interface.HideLockMouse(false);
        }

        //--------------
    }
Beispiel #2
0
    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



    void LateUpdate()
    {
        //--------------

        if (initialScreen.activeSelf == false)
        {
            if (PlayerPrefs.GetInt("FirstStart") == 0)
            {
                firstReported.SetActive(true);
                PlayerPrefs.SetInt("FirstStart", 1);
                PlayerPrefs.SetInt("GraphicsQualityLow", 0);
                PlayerPrefs.SetFloat("LODValue", 1.0f);
                PlayerPrefs.SetFloat("mouseSensitivityValue", 1.0f);
                PlayerPrefs.SetFloat("effectsVolumeValue", 1.0f);
                PlayerPrefs.SetFloat("musicVolumeValue", 0.5f);
                GiveMinerals();
            }

            if (PlayerPrefs.GetInt("FirstStart") != 0 && PlayerPrefs.GetInt("Mineral 0") == 0 && anotherGuardReported.activeSelf == false)
            {
                anotherGuardReported.SetActive(true);
                PlayerPrefs.SetInt("SquareGuardsDied", PlayerPrefs.GetInt("SquareGuardsDied") + 1);
                squareGuardsText.text = "Square guards died : " + PlayerPrefs.GetInt("SquareGuardsDied");
                GiveMinerals();
            }

            if (escMenu.activeSelf == false && firstReported.activeSelf == false && anotherGuardReported.activeSelf == false)
            {
                if (gui.activeSelf == false)
                {
                    gui.SetActive(true);
                }
                if (Class_Interface.menuControlLock == true)
                {
                    Class_Interface.menuControlLock = false;
                }
                Class_Interface.HideLockMouse(hideLockMouse);
                if (Input.GetKeyDown(KeyCode.Q))
                {
                    escMenu.SetActive(true);
                    CheckSettings();
                }
            }
            else if (escMenu.activeSelf == true)
            {
                if (Input.GetKeyDown(KeyCode.Q))
                {
                    _CancelButton();
                }
                masterMixer.SetFloat("EffectsVolume", Mathf.Log(effectsVolumeSlider.value) * Mathf.Abs(Mathf.Log(effectsVolumeSlider.value)) * 15);
                masterMixer.SetFloat("OSTVolume", Mathf.Log(musicVolumeSlider.value) * 22);
            }
        }

        if (initialScreen.activeSelf == true || escMenu.activeSelf == true || firstReported.activeSelf == true || anotherGuardReported.activeSelf == true)
        {
            if (gui.activeSelf == true)
            {
                gui.SetActive(false);
            }
            if (Class_Interface.menuControlLock == false)
            {
                Class_Interface.menuControlLock = true;
            }
            if (escMenu.activeSelf == true || firstReported.activeSelf == true || anotherGuardReported.activeSelf == true)
            {
                Class_Interface.HideLockMouse(false);
            }
        }

        //--------------
    }