#settings menu

1 messages · Page 1 of 1 (latest)

odd tendon
#

Learn how to make an in-game options menu using Unity!

● Sign up for the Devdog Christmas Calender: http://bit.ly/DevdogGiveaway
● START MENU in Unity: https://youtu.be/zc8ac_qUXQY
● Ultimate Game UI: https://www.assetstore.unity3d.com/#!/content/53973?aid=1101lPGj

♥ Support Brackeys on Patreon: http://patreon.com/brackeys/

··················...

▶ Play video
tame barn
#

Make sure you are using the right kind of dropdown.
The one from Text Mesh Pro (which I would recommend you use) has a different type than the built-in one.

odd tendon
#

i am using the text mesh pro do i need to use the built-in one?

tame barn
#

No. You merely need to make sure that you are using the right type in your script.
Meaning instead of UnityEngine.UI.Dropdown, you use TMPro.TMP_Dropdown.

odd tendon
#

this is my code can you tell me what should i replace? using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Audio;
using UnityEngine.UI;

public class SettingsMenu : MonoBehaviour
{
public AudioMixer audioMixer;
public Dropdown resolutionDropDown;

Resolution[] resolutions;
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); 
    }

    resolutionDropDown.AddOptions(options);

}
public void SetVolume(float volume)
{
    audioMixer.SetFloat("volume", volume);
}
public void SetQuality(int qualityIndex)
{
    QualitySettings.SetQualityLevel(qualityIndex);
}
public void FullScreen(bool isFullScreen)
{
    Screen.fullScreen = isFullScreen;
}

}

onyx hullBOT
#

Use codeblocks to send code in a message!

To make a codeblock, surround your code with ```
To use C# syntax highlighting add cs after the three back ticks.

For example:
```cs
Console.WriteLine("Hello World");
```

Produces:

Console.WriteLine("Hello World");

To send lengthy code, paste it into https://paste.myst.rs/ and send the link of the paste into chat.