예제 #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
    private void Update()
    {
        TMPBank.text = MakeRoman(statl.GetDetrizideBank());
        if (!player.gameObject.GetComponent <Unit>().IsDead() && sc.GetGameActive())
        {
            TMPTime.text = MakeRoman(Mathf.FloorToInt(Altar.GetTimeSinceStart()));
        }
        if (gops.GetUIEnabled() && !player.gameObject.GetComponent <Unit>().IsDead() && sc.GetGameActive())
        {
            DisplayStats();
        }
        else if (!player.gameObject.GetComponent <Unit>().IsDead() && !gops.GetUIEnabled())
        {
            ClearStats();
        }

        UpdateAndCheckTutorials();
    }
예제 #3
0
 void Update()
 {
     if (!crosshair)
     {
         crosshair = GameObject.Find("Crosshair");
     }
     if (crosshair)
     {
         if (crosshair.activeInHierarchy != gops.GetUIEnabled())
         {
             crosshair.SetActive(gops.GetUIEnabled());
         }
         if (Input.GetKeyDown(ToggleUI))
         {
             gops.SetUIEnabled(!gops.GetUIEnabled());
             crosshair.SetActive(gops.GetUIEnabled());
         }
     }
 }
예제 #4
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;
    }