Пример #1
0
    IEnumerator BuildOptions()
    {
        yield return(new WaitForFixedUpdate());

        //resolution
        resolutions = Screen.resolutions;
        resolutionDropDown.ClearOptions();
        List <string> options = new List <string>();
        // set dropdown value index and so; value for resolution
        int currentResoIndex = 0;

        for (int i = 0; i < resolutions.Length; i++)
        {
            string option = resolutions[i].width + "x" + resolutions[i].height;
            options.Add(option);

            if (resolutions[i].width == Screen.currentResolution.width &&
                resolutions[i].height == Screen.currentResolution.height)
            {
                currentResoIndex = i;
            }
        }
        resolutionDropDown.AddOptions(options);
        resolutionDropDown.value = currentResoIndex;
        resolutionDropDown.RefreshShownValue();

        //graphics quality
        graphicsDropDown.value = QualitySettings.GetQualityLevel();
        graphicsDropDown.captionText.SetText("Graphics Quality");


        //max health
        healths = healthDropdown.options.ToArray();
        //set health dropdown value index/ current health value
        int currentHealthIndex = 0;

        for (int i = 0; i < healths.Length; i++)
        {
            if (healths[i].text == gops.GetMaxHealth().ToString())
            {
                currentHealthIndex = i;
            }
        }
        healthDropdown.value = currentHealthIndex;
        healthDropdown.RefreshShownValue();


        //mouse sensitivity
        msslider.value = FindObjectOfType <InputController>().mouseSensitivity;
        msnumber.text  = msslider.value.ToString();

        //music volume
        mpslider.value   = mpaso.gameObject.GetComponent <MusicPlayer>().GetChosenVolume();
        musicnumber.text = TruncateString(mpaso.volume.ToString(), 4);

        //toggles
        tutorialToggle.isOn = gops.GetTutorialsEnabled();
        uitoggle.isOn       = gops.GetUIEnabled();
    }
Пример #2
0
    public SaveData(int score, GameOptions go, InputController input, float mvol, int rwidth, int rheight, int gqual)
    {
        highScore = score;
        //Options info
        musicVolume = mvol;
        reswidth    = rwidth;
        resheight   = rheight;
        gqualindex  = gqual;

        //GameOptions info;
        tutorialsEnabled = go.GetTutorialsEnabled();
        UIenabled        = go.GetUIEnabled();
        defaultMaxHealth = go.GetMaxHealth();
        //InputController info
        MoveUp       = input.MoveUp;
        MoveDown     = input.MoveDown;
        MoveLeft     = input.MoveLeft;
        MoveRight    = input.MoveRight;
        Detrizide    = input.Detrizide;
        Jump         = input.Jump;
        ToggleMusic  = input.ToggleMusic;
        ToggleUI     = input.ToggleUI;
        Reset        = input.Reset;
        Exit         = input.Exit;
        CycleWeapons = input.CycleWeapons;
        NextWeapon   = input.NextWeapon;
        //guns
        Gauntlets  = input.Gauntlets;
        BoneBag    = input.BoneBag;
        Shotgun    = input.Shotgun;
        Devourer   = input.Devourer;
        Reaver     = input.Reaver;
        Crucifier  = input.Crucifier;
        VoidCannon = input.VoidCannon;

        mouseSensitivity = input.mouseSensitivity;
    }
Пример #3
0
    private void UpdateAndCheckTutorials()
    {
        if (gops.GetTutorialsEnabled())
        {
            if (TMPTUT.text == killtext && statl.GetDetrizide() > 0)
            {
                StartCoroutine(ClearTutorials());
                killtutdone = true;
            }
            else if (killtutdone && !dttutdone && TMPTUT.text == "")
            {
                StartCoroutine(DelayedTut(5, "detrizide"));
                dttutdone = true;
            }
            else if (dttutdone && TMPTUT.text == dttext && Input.GetKeyDown(ic.Detrizide))
            {
                StartCoroutine(ClearTutorials());
            }
            else if (wb.GetComponentInChildren <Pickup>() && !weapontutdone && TMPTUT.text == "")
            {
                DisplayTutorial("weapons");
                weapontutdone = true;
            }
            else if (weapontutdone && TMPTUT.text == weapontext && !wb.GetComponentInChildren <Pickup>())
            {
                StartCoroutine(ClearTutorials());
            }
            else if (pab.GetComponentInChildren <Pickup>() && !passivetutdone && TMPTUT.text == "")
            {
                DisplayTutorial("passives");
                passivetutdone = true;
            }
            else if (passivetutdone && TMPTUT.text == passivetext && !pab.GetComponentInChildren <Pickup>())
            {
                StartCoroutine(ClearTutorials());
            }
            else if (pob.GetComponentInChildren <Pickup>() && !poweruptutdone && TMPTUT.text == "")
            {
                DisplayTutorial("powerups");
                poweruptutdone = true;
            }
            else if (poweruptutdone && TMPTUT.text == poweruptext && !pob.GetComponentInChildren <Pickup>())
            {
                StartCoroutine(ClearTutorials());
            }
            if (TMPTUT.text == ammotext && (Input.GetKeyDown(ic.CycleWeapons) || Input.GetKeyDown(ic.NextWeapon)))
            {
                StartCoroutine(ClearTutorials());
                ammotutdone = true;
            }

            if (player.GetCurrentWeapon())
            {
                if ((player.GetCurrentWeapon().name == "Void Cannon" || player.GetCurrentWeapon().name == "Devourer") && !swdone && TMPTUT.text == "")
                {
                    DisplayTutorial("sw");
                    swdone = true;
                    StartCoroutine(ClearTutorials(25));
                }
            }

            if (swdone && !finaldone && TMPTUT.text == "")
            {
                finaldone = true;
                StartCoroutine(DelayedTut(15, "final"));
                StartCoroutine(ClearTutorials(25));
            }
        }
    }