public IEnumerator SaveVideoSettings()
        {
            SaveSettings.CurrentQualityLevelIni = QualitySettings.GetQualityLevel();
            SaveSettings.MsaaIni = msaaDropdown.value;
            SaveSettings.AnisotropicFilteringLevelIni = anisotropicDropdown.value;
            SaveSettings.RenderDistIni    = renderDistSlider.value;
            SaveSettings.TextureLimitIni  = (int)masterTexSlider.value;
            SaveSettings.ShadowDistIni    = shadowDistSlider.value;
            SaveSettings.ShadowCascadeIni = (int)shadowCascadesSlider.value;
            yield return(StartCoroutine(CoroutineUtilities.WaitForRealTime(0.5f)));

            GameManager.Instance.SaveGameSettings();
            _panel.SetActive(false);
        }
예제 #2
0
    IEnumerator Start()
    {
        Vector3 newPos;        // = transform.localPosition;
        int     flip = 10;

        while (true)
        {
            flip      = -flip;
            newPos    = ((RectTransform)transform).localPosition;
            newPos.y -= flip;
            ((RectTransform)transform).localPosition = newPos;

            yield return(StartCoroutine(CoroutineUtilities.WaitForRealTime(0.25f)));
        }
    }
예제 #3
0
        /// <summary>
        /// Use an IEnumerator to first play the animation and then changethe video settings
        /// </summary>
        /// <returns></returns>
        internal IEnumerator cancelVideoMain()
        {
            vidPanelAnimator.Play("Video Panel Out");

            yield return(StartCoroutine(CoroutineUtilities.WaitForRealTime((float)vidPanelAnimator.GetCurrentAnimatorClipInfo(0).Length)));

            try
            {
                mainCam.farClipPlane = renderDistINI;
                Terrain.activeTerrain.detailObjectDensity = densityINI;
                mainCam.fieldOfView = fovINI;
                mainPanel.SetActive(true);
                vidPanel.SetActive(false);
                audioPanel.SetActive(false);
                aoBool  = lastAOBool;
                dofBool = lastDOFBool;
                Screen.SetResolution(beforeRes.width, beforeRes.height, Screen.fullScreen);
                QualitySettings.shadowDistance     = shadowDistINI;
                QualitySettings.antiAliasing       = (int)aaQualINI;
                QualitySettings.antiAliasing       = msaaINI;
                QualitySettings.vSyncCount         = vsyncINI;
                QualitySettings.masterTextureLimit = lastTexLimit;
                QualitySettings.shadowCascades     = lastShadowCascade;
                Screen.fullScreen = isFullscreen;
            }
            catch
            {
                Debug.Log("A problem occured (chances are the terrain was not assigned )");
                //mainCam.farClipPlane = renderDistINI;
                mainCam.fieldOfView = fovINI;
                mainPanel.SetActive(true);
                vidPanel.SetActive(false);
                audioPanel.SetActive(false);
                aoBool  = lastAOBool;
                dofBool = lastDOFBool;
                QualitySettings.shadowDistance = shadowDistINI;
                Screen.SetResolution(beforeRes.width, beforeRes.height, Screen.fullScreen);
                QualitySettings.antiAliasing       = (int)aaQualINI;
                QualitySettings.antiAliasing       = msaaINI;
                QualitySettings.vSyncCount         = vsyncINI;
                QualitySettings.masterTextureLimit = lastTexLimit;
                QualitySettings.shadowCascades     = lastShadowCascade;
                //Screen.fullScreen = isFullscreen;
            }
        }
        /// <summary>
        /// Use an IEnumerator to first play the animation and then changethe video settings
        /// </summary>
        /// <returns></returns>
        internal IEnumerator CancelVideoMain()
        {
            VidPanelAnimator.Play("Video Panel Out");

            yield return(StartCoroutine(CoroutineUtilities.WaitForRealTime((float)VidPanelAnimator.GetCurrentAnimatorClipInfo(0).Length)));

            try
            {
                MainCam.farClipPlane = RenderDistIni;
                Terrain.activeTerrain.detailObjectDensity = DensityIni;
                MainCam.fieldOfView = FovIni;
                MainPanel.SetActive(true);
                VidPanel.SetActive(false);
                AudioPanel.SetActive(false);
                AoBool  = _lastAoBool;
                DofBool = _lastDofBool;
                Screen.SetResolution(_beforeRes.width, _beforeRes.height, Screen.fullScreen);
                QualitySettings.shadowDistance     = ShadowDistIni;
                QualitySettings.antiAliasing       = (int)AaQualIni;
                QualitySettings.antiAliasing       = MsaaIni;
                QualitySettings.vSyncCount         = VsyncIni;
                QualitySettings.masterTextureLimit = LastTexLimit;
                QualitySettings.shadowCascades     = LastShadowCascade;
                Screen.fullScreen = _isFullscreen;
            }
            catch
            {
                Debug.Log("A problem occured (chances are the terrain was not assigned )");
                MainCam.farClipPlane = RenderDistIni;
                MainCam.fieldOfView  = FovIni;
                MainPanel.SetActive(true);
                VidPanel.SetActive(false);
                AudioPanel.SetActive(false);
                AoBool  = _lastAoBool;
                DofBool = _lastDofBool;
                QualitySettings.shadowDistance = ShadowDistIni;
                Screen.SetResolution(_beforeRes.width, _beforeRes.height, Screen.fullScreen);
                QualitySettings.antiAliasing       = (int)AaQualIni;
                QualitySettings.antiAliasing       = MsaaIni;
                QualitySettings.vSyncCount         = VsyncIni;
                QualitySettings.masterTextureLimit = LastTexLimit;
                QualitySettings.shadowCascades     = LastShadowCascade;
                //Screen.fullScreen = isFullscreen;
            }
        }
예제 #5
0
    //Show the FIRST and the SECOND TUTORIAL
    IEnumerator ShowTutorial(GameObject[] tutorial, GameObject effect)
    {
        Man.GetComponent <CharacterBehaviour>().SetInput(false);
        Woman.GetComponent <CharacterBehaviour>().SetInput(false);

        if (_numTutorial != 0 && !_explosion)
        {
            BlackBackground.SetActive(true);
            tutorial[0].SetActive(true);
            yield return(StartCoroutine(CoroutineUtilities.WaitForRealTime(0.2f)));

            //Change input for tutorial
            screenInput[0].SetActive(false);
            screenInput[1].SetActive(false);
            screenInput[2].SetActive(false);
            screenInput[3].SetActive(false);
            screenInput[4].SetActive(true); //set Tutorial
            screenInput[5].SetActive(true); //set Tutorial
        }

        StopCoroutine("ShowTutorial");
        _nextImage = true;
    }
예제 #6
0
        /// <summary>
        /// Use an IEnumerator to first play the animation and then change the video settings.
        /// </summary>
        /// <returns></returns>
        internal IEnumerator applyVideo()
        {
            vidPanelAnimator.Play("Video Panel Out");
            yield return(StartCoroutine(CoroutineUtilities.WaitForRealTime((float)vidPanelAnimator.GetCurrentAnimatorClipInfo(0).Length)));

            mainPanel.SetActive(true);
            vidPanel.SetActive(false);
            audioPanel.SetActive(false);
            renderDistINI = mainCam.farClipPlane;
            shadowDistINI = QualitySettings.shadowDistance;
            Debug.Log("Shadow dist ini" + shadowDistINI);
            fovINI            = mainCam.fieldOfView;
            aoBool            = aoToggle.isOn;
            dofBool           = dofToggle.isOn;
            lastAOBool        = aoBool;
            lastDOFBool       = dofBool;
            beforeRes         = currentRes;
            lastTexLimit      = QualitySettings.masterTextureLimit;
            lastShadowCascade = QualitySettings.shadowCascades;
            vsyncINI          = QualitySettings.vSyncCount;
            isFullscreen      = Screen.fullScreen;
            try
            {
                if (useSimpleTerrain == true)
                {
                    densityINI     = simpleTerrain.detailObjectDensity;
                    treeMeshAmtINI = simpleTerrain.treeMaximumFullLODCount;
                }
                else
                {
                    densityINI     = terrain.detailObjectDensity;
                    treeMeshAmtINI = simpleTerrain.treeMaximumFullLODCount;
                }
            }
            catch { Debug.Log("Please assign a terrain"); }
            saveSettings.SaveGameSettings();
        }
예제 #7
0
    IEnumerator OpenMainMenuDelayed(float delay)
    {
        yield return(StartCoroutine(CoroutineUtilities.WaitForRealTime(delay)));

        openingMenu.ShowIntro(false, 0);
    }