Example #1
0
 public void OnExitClick()
 {
     LibPlacenote.Instance.StopSession();
     FeaturesVisualizer.clearPointcloud();
     initialized       = false;
     haveMapName       = false;
     mapping           = false;
     localizeFirstTime = false;
     mInitButtonPanel.SetActive(true);
     mExitButton.SetActive(false);
     mExtendedPanel.SetActive(false);
     mActivateDesButton.SetActive(false);
     mMappingButtonPanel.SetActive(false);
     DropdownList.gameObject.SetActive(false);
     scanPopup.SetActive(false);
     selectDesPopUp.SetActive(false);
     waitPopUp.SetActive(false);
     destination = null;
     destinationList.Clear();
     DropdownList.value = 0;
     DropdownList.options.Clear();
     DropdownList.RefreshShownValue();
     shapeManager.ClearShapes();
     navController.ReSetParameter();
     infoManager.Close();
     StopAllCoroutines();
     StartCoroutine(UIcheck());
 }
Example #2
0
    void Start()
    {
        int currentResIndex = 0;

        ScreenResolutions = Screen.resolutions;
        resolutionDropDown.ClearOptions();
        difficultyDP.value = PlayerPrefs.GetInt("Difficulty");
        difficultyDP.RefreshShownValue();

        List <string> options = new List <string>();

        //PlayerPrefs.GetInt("Difficulty", 0);

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

            if (ScreenResolutions[i].width == Screen.currentResolution.width &&
                ScreenResolutions[i].height == Screen.currentResolution.height)
            {
                currentResIndex = i;
            }
        }

        resolutionDropDown.AddOptions(options);
        resolutionDropDown.value = currentResIndex;
        resolutionDropDown.RefreshShownValue();
    }
Example #3
0
    public void LoadSettingsData()
    {
        if (PlayerPrefs.GetInt(Constants.pp_firstTime) != 0)
        {
            qualityIndex    = PlayerPrefs.GetInt(Constants.pp_quality);
            resolutionIndex = PlayerPrefs.GetInt(Constants.pp_resolution);
            isFullscreen    = PlayerPrefs.GetInt(Constants.pp_fullscreen) == 1;

            Resolution resolution = resolutions[resolutionIndex];
            Screen.SetResolution(resolution.width, resolution.height, Screen.fullScreen);
            resolutionDropdown.value = resolutionIndex;
            resolutionDropdown.RefreshShownValue();

            Screen.fullScreen     = isFullscreen;
            fullScreenToggle.isOn = isFullscreen;

            QualitySettings.SetQualityLevel(qualityIndex);
            qualityDropdown.value = qualityIndex;
            qualityDropdown.RefreshShownValue();

            musicSlider.value = PlayerPrefs.GetFloat(Constants.pp_musicVolume);
            soundSlider.value = PlayerPrefs.GetFloat(Constants.pp_soundVolume);
        }
        else
        {
            PlayerPrefs.SetInt(Constants.pp_firstTime, 1);

            resolutionDropdown.value = defaultResolutionIndex;
            resolutionDropdown.RefreshShownValue();
        }
    }
Example #4
0
    // Start is called before the first frame update
    void Start()
    {
        resolutions = Screen.resolutions;
        resolutionDropdown.ClearOptions();
        List <string> options = new List <string>();

        int currentResolutionIndex = 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.width &&
                resolutions[i].height == Screen.height)
            {
                currentResolutionIndex = i;
            }
        }
        if (options.Count == 0)
        {
            options.Add("No options");
            resolutionDropdown.AddOptions(options);
            resolutionDropdown.RefreshShownValue();
        }
        else
        {
            resolutionDropdown.AddOptions(options);
            resolutionDropdown.value = currentResolutionIndex;
            resolutionDropdown.RefreshShownValue();
        }
    }
Example #5
0
    void Start()
    {
        mapliste.Clear();
        mapsDropdown.ClearOptions();

        mapliste.Add("Random"); //set Random to index 0

        //add the Maps to the list
        foreach (var map in mapContainer.Maps)
        {
            mapliste.Add(map.Key);
        }
        mapsDropdown.AddOptions(mapliste); //add the list to show in dropdown menu
        mapsDropdown.RefreshShownValue();

        mapContainer.SetChosenMap(mapsDropdown.captionText.text); //Reset the chosenMap to random

        minCellsInX = cellProperties.minCellsInX;
        maxCellsInX = cellProperties.maxCellsInX;
        minFPS      = cellProperties.minFPS;
        maxFPS      = cellProperties.maxFPS;

        UpdateFPSValueFromFloat(10);
        UpdateXCellsValueFromFloat(100);
    }
Example #6
0
    private void Start()
    {
        if (SceneManager.GetActiveScene().buildIndex == 0)
        {
            resolutions = Screen.resolutions;
            resolutionDropdown.ClearOptions();

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

                if (resolutions[i].ToString() == Screen.currentResolution.ToString())
                {
                    currentResolutionIndex = i;
                }
            }
            resolutionDropdown.AddOptions(options);

            if (!ES3.KeyExists("ResolutionIndex"))
            {
                resolutionDropdown.value = currentResolutionIndex;
                resolutionDropdown.RefreshShownValue();
            }

            LoadSettings();
            SetLoadGameButtons();
        }
    }
Example #7
0
    private void Start()
    {
        resolutions = Screen.resolutions;
        resolutionDropdown.ClearOptions();

        List <string> options = new List <string>();

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

            //Si no hay resolución guardada se pone por defecto en 1920 x 1080
            if (!PlayerPrefs.HasKey(AppPlayerPrefKeys.RESOLUTION) && resolutions[i].width == 1920 && resolutions[i].height == 1080)
            {
                PlayerPrefs.SetInt(AppPlayerPrefKeys.RESOLUTION, i);
            }
        }

        resolutionDropdown.AddOptions(options);
        resolutionDropdown.value = PlayerPrefs.GetInt(AppPlayerPrefKeys.RESOLUTION);
        resolutionDropdown.RefreshShownValue();

        //Si no hay ajuste guardado se pone por defecto en fullscreen
        if (!PlayerPrefs.HasKey(AppPlayerPrefKeys.FULLSCREEN))
        {
            SetFullScreen(true);
        }

        else
        {
            if (PlayerPrefs.GetInt(AppPlayerPrefKeys.FULLSCREEN) == 0)
            {
                SetFullScreen(false);
            }
            else
            {
                SetFullScreen(true);
            }
        }

        //Valores iniciales calidad
        if (PlayerPrefs.HasKey(AppPlayerPrefKeys.QUALITY_LEVEL))
        {
            SetQuality(5);
        }

        else
        {
            SetQuality(PlayerPrefs.GetInt(AppPlayerPrefKeys.QUALITY_LEVEL));
        }

        //Valores iniciales de slider
        musicSlider.value = Mathf.Clamp(SoundManager.Instance.MusicVolume, 0, 1);
        sFXSlider.value   = Mathf.Clamp(SoundManager.Instance.SfxVolume, 0, 1);
    }
Example #8
0
        /// <summary>
        /// Selects the given tab. Enables all other buttons in row, disables the selected one, and refreshes the channel dropdown.
        /// </summary>
        /// <param name="selectedButton">The button of the tab to be selected.</param>
        public void SelectTab(GameObject selectedTab)
        {
            EnableAllTabs();
            Button selectedButton = selectedTab.GetComponent <Button>();

            selectedButton.interactable = false;
            LoadTab(selectedTab.GetComponent <ChatTab>().GetChatTabData());
            channelDropDown.value = 0;
            channelDropDown.RefreshShownValue();
        }
Example #9
0
    } // очищаю поля

    public void ChangeSurfaceDefect()
    {
        AV = AppManager.Instance.allowed_values.allowed_values;
        defect.options.Clear();
        for (int val = 0; val < AV.note_surface_defect.Count; val++)
        {
            defect.options.Add(new TMP_Dropdown.OptionData(AV.note_surface_defect[val].value));
        }
        defect.RefreshShownValue();
    }
Example #10
0
        // Start is called before the first frame update
        protected void Start()
        {
            settings = GetComponent <SystemSettings>();

            if (settings && SaveSystemXml.CheckFileExsits())
            {
                SystemSettingsData settingsData = SaveSystemXml.LoadSettings();
                settings.fullscreen     = settingsData.Fullscreen;
                settings.resolution     = settingsData.Resolution;
                settings.vsyncCount     = settingsData.VsyncCount;
                settings.graphicsPreset = settingsData.GraphicsPreset;
                settings.masterVolume   = settingsData.MasterVolume;
                settings.effectsVolume  = settingsData.EffectsVolume;
            }
            else
            {
                SaveSystemXml.SaveSettings(settings);
            }

            if (resolutionDropdown)
            {
                FindSupportedResolutions();
                Screen.SetResolution(settings.resolution[0], settings.resolution[1], Screen.fullScreen);
            }

            if (qualityDropdown)
            {
                qualityDropdown.value = settings.graphicsPreset;
                qualityDropdown.RefreshShownValue();
                QualitySettings.SetQualityLevel(settings.graphicsPreset);
            }

            if (fullscreenDropdown)
            {
                if (settings.fullscreen == true)
                {
                    fullscreenDropdown.value = 1;
                    fullscreenDropdown.RefreshShownValue();
                }
                else
                {
                    fullscreenDropdown.value = 0;
                    fullscreenDropdown.RefreshShownValue();
                }

                Screen.fullScreen = settings.fullscreen;
            }

            if (vsyncDropdown)
            {
                vsyncDropdown.value = settings.vsyncCount;
                vsyncDropdown.RefreshShownValue();
                QualitySettings.vSyncCount = settings.vsyncCount;
            }
        }
Example #11
0
    public void ReloadDropdownOptions()
    {
        CharacterSelectorDropdown.ClearOptions();
        foreach (var character in Characters)
        {
            CharacterSelectorDropdown.options.Add(new TMP_Dropdown.OptionData(character.Name));
        }

        CharacterSelectorDropdown.SetValueWithoutNotify(0);
        CharacterSelectorDropdown.RefreshShownValue();
        OnSelectionChange();
    }
        /*
         * public override void Interact() {
         *  base.Interact();
         *  interacting = true;
         *  //inputField.ActivateInputField();
         *  dropDown.Show();
         * }
         */

        public override void UpButton()
        {
            base.UpButton();
            if (dropDown.value > 0)
            {
                dropDown.value--;
                dropDown.RefreshShownValue();
                dropDown.Hide();
                dropDown.Show();
                ScrollToCurrentItem();
            }
        }
Example #13
0
    void Start()
    {
        difficulty        = 0;
        numberOfHexagones = 3;
        MOD = 0;

        DifficultyDP.value = PlayerPrefs.GetInt("Difficulty");
        DifficultyDP.RefreshShownValue();
        numberOfHexagonesDP.value = PlayerPrefs.GetInt("NumberOfHexagones");
        numberOfHexagonesDP.RefreshShownValue();
        ModDP.value = PlayerPrefs.GetInt("MOD");
        ModDP.RefreshShownValue();
    }
Example #14
0
 // Updates the value of dropdown so the new value points to
 // currentOptions if it is among the dropdown's options.
 public static void MemoryToDropdown(TMP_Dropdown dropdown,
                                     string currentOption, int defaultValue = 0)
 {
     for (int i = 0; i < dropdown.options.Count; i++)
     {
         if (dropdown.options[i].text == currentOption)
         {
             dropdown.SetValueWithoutNotify(i);
             dropdown.RefreshShownValue();
             return;
         }
     }
     dropdown.SetValueWithoutNotify(defaultValue);
     dropdown.RefreshShownValue();
 }
Example #15
0
        internal override void Show()
        {
            base.Show();
            IsSideChanging = false;
            explorer.Show();
            SetVisible(dpdDecks.transform, true);
            SetVisible(dpdFList.transform, true);
            SetVisible(btnFinishSide.transform, false);
            SetVisible(btnClear.transform, true);
            SetVisible(btnCopy.transform, true);
            SetVisible(btnDelete.transform, true);
            SetVisible(btnExit.transform, true);
            SetVisible(btnRename.transform, true);
            SetVisible(btnSave.transform, true);
            DeckService.ForbiddenLists.ForEach((fl) => dpdFList.options.Add(new TMP_Dropdown.OptionData(fl.Name)));
            dpdFList.value = 0;
            dpdFList.RefreshShownValue();
            CurrentFList = DeckService.ForbiddenLists[0];
            var names = DeckService.GetAllNames();

            if (names.Count == 0)
            {
                File.Create(Config.DeckPath + "new deck.ydk");
                names.Add("new deck.ydk");
            }
            bool found = false;

            for (int i = 0; i < names.Count; ++i)
            {
                dpdDecks.options.Add(new TMP_Dropdown.OptionData(names[i]));
                if (Config.GetString("LastDeck", "") == names[i])
                {
                    found          = i != dpdDecks.value;
                    dpdDecks.value = i;
                }
            }
            dpdDecks.RefreshShownValue();
            if (!found)
            {
                SwitchToDeck(Config.DeckPath + dpdDecks.options[dpdDecks.value].text + ".ydk");
            }
            MainCount.gameObject.SetActive(true);
            ExtraCount.gameObject.SetActive(true);
            SideCount.gameObject.SetActive(true);
            MainGame.Instance.CameraToBuilder();
            MainGame.Instance.Descriptor.Show();
            MainGame.Instance.FrameActions.Add(FocusInput);
        }
Example #16
0
    private void Start()
    {
        // initialize options
        // Graphics
        if (PlayerPrefs.HasKey("Graphics"))
        {
            graphicsDropdown.value = PlayerPrefs.GetInt("Graphics");
        }
        else
        {
            graphicsDropdown.value = 2; // High graphics by default
        }
        graphicsDropdown.RefreshShownValue();

        // Volume
        if (PlayerPrefs.HasKey("Volume"))
        {
            volumeSlider.value = PlayerPrefs.GetFloat("Volume");
        }
        else
        {
            volumeSlider.value = 0.6f; // 60% global volume by default
        }

        // HighScore
        score = new ScoreScript();
        if (PlayerPrefs.HasKey("HighScore"))
        {
            highScore.text = PlayerPrefs.GetInt("HighScore").ToString();
        }
        else
        {
            highScore.text = "0"; // 0 if high score does not exist before
        }
    }
Example #17
0
    /// <summary>
    /// Private method called before the first frame.
    /// </summary>
    private void Start()
    {
        // Adds all the resolutions of the existing ones to the dropdown.
        resolutions = Screen.resolutions;
        resolutionDropdown.ClearOptions();
        List <string> options = new List <string>();

        currentresolutionIndex = 0;

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

            if (resolutions[i].width == Screen.currentResolution.width &&
                resolutions[i].height == Screen.currentResolution.height)
            {
                currentresolutionIndex = i;
            }
        }
        resolutionDropdown.AddOptions(options);
        resolutionDropdown.value = currentresolutionIndex;
        resolutionDropdown.RefreshShownValue();
    }
Example #18
0
    void Start()
    {
        resolutions = Screen.resolutions;

        // clear out all the options in our resolution dropdown
        resolutionDropDown.ClearOptions();

        // create a list of strings
        List <string> options = new List <string>();

        // create variable for correct default resolution
        int currentResolutionIndex = 0;

        // loop through each element in our resolutions array
        for (int i = 0; i < resolutions.Length; i++)
        {
            // for each element we create a formatted string that displays the resolution
            string option = resolutions[i].width + " x " + resolutions[i].height;
            // add the resolution to the list
            options.Add(option);

            // compares the current resolution in the list to the screen's current resolution (by looking at the width and height becuase you can't compare resolutions)
            if (resolutions[i].width == Screen.currentResolution.width && resolutions[i].height == Screen.currentResolution.height)
            {
                currentResolutionIndex = i;
            }
        }

        // adds the options list to resolutions dropdown
        resolutionDropDown.AddOptions(options);

        // sets the default screen resolution to the proper resolution
        resolutionDropDown.value = currentResolutionIndex;
        resolutionDropDown.RefreshShownValue();
    }
Example #19
0
        private void NewSelection(DialogEventListItem selection)
        {
            if (lastSelected && selection.transform != lastSelected)
            {
                lastSelected.Select(false);
            }
            lastSelected = selection;

            selection.Select(true);

            durationInput.text = selection.dialogEvent.duration.ToString();

            toggleL.SetIsOnWithoutNotify(selection.dialogEvent.leftCharacter);

            eventTypeDropdown.SetValueWithoutNotify((int)selection.dialogEvent.type);
            eventTypeDropdown.RefreshShownValue();

            if (selection.dialogEvent.CharacterData)
            {
                int index = characterDropdown.options.FindIndex(
                    x => x.text.Equals(selection.dialogEvent.CharacterData.name));
                characterDropdown.SetValueWithoutNotify(index);
                characterDropdown.RefreshShownValue();
            }

            textInput.text          = selection.dialogEvent.text;
            animTriggerInput.text   = selection.dialogEvent.animationTrigger;
            spriteTriggerInput.text = selection.dialogEvent.spriteTrigger;

            targetXInput.text = selection.dialogEvent.target.x.ToString();
            targetYInput.text = selection.dialogEvent.target.y.ToString();

            ToggleInputs(selection.dialogEvent.type);
        }
    private void FillFields()
    {
        foreach (WebCamDevice device in WebCamTexture.devices)
        {
            devicesDropdown.options.Add(new TMP_Dropdown.OptionData(device.name));
        }

        WebCamDevice currentDevice = WebCamTexture.devices[0];

        ClearAndFillResolutions(currentDevice);

        foreach (string name in QualitySettings.names)
        {
            qualitySettingsDropdown.options.Add(new TMP_Dropdown.OptionData(name));
        }

        targetFrameRateInput.text = (ParamatersManager.Instance.TargetFrameRate != null ? ParamatersManager.Instance.TargetFrameRate.ToString() : string.Empty);
        requestedFpsInput.text    = (ParamatersManager.Instance.RequestedFPS != null ? ParamatersManager.Instance.RequestedFPS.ToString() : string.Empty);
        vSyncCountDropdown.value  = ParamatersManager.Instance.VSyncCount;
        vSyncCountDropdown.onValueChanged.Invoke(vSyncCountDropdown.value);
        qualitySettingsDropdown.value = ParamatersManager.Instance.QualitySettingsLevel;
        qualitySettingsDropdown.RefreshShownValue();
        delayFrameMinInput.text        = ParamatersManager.Instance.DelayFrameMin.ToString();
        decodeIntervalInput.text       = ParamatersManager.Instance.DecodeInterval.ToString();
        parserTryHarderToggle.isOn     = ParamatersManager.Instance.ParserTryHarder;
        webcamFilterModeDropdown.value = ParamatersManager.Instance.WebcamFilterMode;
    }
Example #21
0
        private void SetResolutionOptions()
        {
            resolutions = Screen.resolutions.Select(r =>
                                                    new Resolution
            {
                width  = r.width,
                height = r.height
            }).Distinct().Where(r =>
                                Math.Abs((float)r.width / r.height - 16f / 9f) < 0.002f).ToArray();

            Array.Reverse(resolutions);
            resolutionDropdown.ClearOptions();

            var options         = new List <string>();
            var resolutionIndex = 0;

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

                if (resolutions[i].width == Screen.width &&
                    resolutions[i].height == Screen.height)
                {
                    resolutionIndex = i;
                }
            }

            resolutionDropdown.AddOptions(options);
            resolutionDropdown.value = resolutionIndex;
            resolutionDropdown.RefreshShownValue();
        }
    private void Start()
    {
        //resolutions = Screen.resolutions;
        resolutionDropdown.ClearOptions();
        List <string> options = new List <string>();

        int currentres = 0;

        resolutions = Screen.resolutions.Select(resolution => new Resolution {
            width = resolution.width, height = resolution.height
        }).Distinct().ToArray();
        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)
            {
                currentres = i;
            }
        }
        resolutionDropdown.AddOptions(options);
        tog.isOn = Screen.fullScreen;
        resolutionDropdown.value = currentres;
        resolutionDropdown.RefreshShownValue();

        qualityDropdown.value = QualitySettings.GetQualityLevel();
        qualityDropdown.RefreshShownValue();
    }
Example #23
0
    private void Start()
    {
        Resolutions = Screen.resolutions;
        ResolutionSettings.ClearOptions();
        List <string> StringResolutions = new List <string>();

        int currentResolutionIndex = 0;

        for (int i = 0; i < Resolutions.Length; i++)
        {
            string option = Resolutions[i].width + " x " + Resolutions[i].height;
            if (!StringResolutions.Contains(option))
            {
                StringResolutions.Add(option);
                if ((Resolutions[i].width == Screen.currentResolution.width) && Resolutions[i].height == Screen.currentResolution.height)
                {
                    currentResolutionIndex = i;
                }
            }
        }
        ResolutionSettings.AddOptions(StringResolutions);
        ResolutionSettings.value = currentResolutionIndex;
        ResolutionSettings.RefreshShownValue();
        FullscreenToggle.isOn        = PlayerPrefs.HasKey("Fullscreen") ? (PlayerPrefs.GetInt("Fullscreen") != 0) : MainMenuScript.DefaultFullscreen;
        MouseSensitivitySlider.value = PlayerPrefs.HasKey("MouseSensitivity") ? PlayerPrefs.GetFloat("MouseSensitivity") : MainMenuScript.DefaultMouseSensitivity;
        VolumeSlider.value           = PlayerPrefs.HasKey("MasterVolume") ? PlayerPrefs.GetFloat("MasterVolume") : MainMenuScript.DefaultVolumeLevel;
        GraphicSettings.value        = PlayerPrefs.HasKey("QualityLevel") ? PlayerPrefs.GetInt("QualityLevel") : MainMenuScript.DefaultQuality;
        PlayerPrefs.Save();
    }
    void Start()
    {
        resolutions = Screen.resolutions;
        resDropdown.ClearOptions();
        List <string> resOptions             = new List <string>();
        int           currentResolutionIndex = 0;

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

            if (resolutions[i].width == Screen.width &&
                resolutions[i].height == Screen.height)
            {
                currentResolutionIndex = i;
            }
        }
        resDropdown.AddOptions(resOptions);
        resDropdown.value = currentResolutionIndex;
        resDropdown.RefreshShownValue();

        fullScreenToggle.isOn = Screen.fullScreen;

        Application.targetFrameRate = 60;
        QualitySettings.vSyncCount  = 0;
    }
Example #25
0
    void ManageResolutions()
    {
        Resolution[] allResolutions = Screen.resolutions;
        resolutions = new List <Resolution>();
        foreach (Resolution res in allResolutions)
        {
            if (9 * res.width == 16 * res.height)
            {
                resolutions.Add(res);
            }
        }
        resolutionDropdown.ClearOptions();
        List <string> options = new List <string>();
        int           currentResolutionIndex = 0;

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

            if (resolutions[i].width == Screen.currentResolution.width && resolutions[i].height == Screen.currentResolution.height)
            {
                currentResolutionIndex = i;
            }
        }

        resolutionDropdown.AddOptions(options);
        resolutionDropdown.value = currentResolutionIndex;
        resolutionDropdown.RefreshShownValue();
    }
Example #26
0
    void Start()
    {
        resolutions = Screen.resolutions.Select(resolution => new Resolution {
            width = resolution.width, height = resolution.height
        }).Distinct().ToArray();

        resolutionDropdown.ClearOptions();

        List <string> options = new List <string>();

        int currentResolutionIndex = 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.width && resolutions[i].height == Screen.height)
            {
                currentResolutionIndex = i;
            }
        }

        resolutionDropdown.AddOptions(options);
        resolutionDropdown.value = currentResolutionIndex;
        resolutionDropdown.RefreshShownValue();
    }
Example #27
0
    void Start()
    {
        resolutions = Screen.resolutions;
        resolutionDropdown.ClearOptions();
        List <string> options = new List <string>();

        int currentResolutionIndex = 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)
            {
                currentResolutionIndex = i;
            }
        }
        resolutionDropdown.AddOptions(options);
        resolutionDropdown.value = currentResolutionIndex;
        resolutionDropdown.RefreshShownValue();

        SetMasterVolume(defaultMasterVolume);
        SetMusicVolume(defaultMusicVolume);
    }
Example #28
0
    void Start()
    {
        resolutions = Screen.resolutions;

        resolutionDropdown.ClearOptions();

        List <string> options = new List <string>();

        int currentResolutionIndex = 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)
            {
                currentResolutionIndex = i;
            }
        }

        resolutionDropdown.AddOptions(options);
        resolutionDropdown.value = currentResolutionIndex;
        resolutionDropdown.RefreshShownValue();

        float temp = slider.value;

        audioMixer.GetFloat("volume", out temp);
        slider.value = temp;
    }
Example #29
0
    // Fills dropdown with the latest 5 access codes
    public void FillDropdown()
    {
        int j = 0;

        foreach (AssignmentReportClass ac in ACList)
        {
            // create another condition to account for ACList less than 5 to prevent index errors
            if (j == 5)
            {
                break;
            }
            AssignmentAccessCodes.options.Add(new TMP_Dropdown.OptionData()
            {
                text = ac.AccessCode.ToString()
            });
            j++;
        }
        AssignmentAccessCodes.RefreshShownValue();

        // initialise first(latest) assignment report
        StartDateText.text = ACList[0].StartTime;
        EndDateText.text   = ACList[0].EndTime;
        AvgScoreText.text  = ACList[0].AverageScore.ToString();
        StandardDText.text = ACList[0].StandardDeviation.ToString();
    }
Example #30
0
    void Start()
    {
        //ustawienie domyslnej rozdzielczosci w menu
        resolutions = Screen.resolutions;

        resolutionDropdown.ClearOptions();

        List <string> options = new List <string>();

        int currentResolutionIndex = 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)
            {
                currentResolutionIndex = i;
            }
        }

        resolutionDropdown.AddOptions(options);
        resolutionDropdown.value = currentResolutionIndex;
        resolutionDropdown.RefreshShownValue();
    }