Raymond Maarloeve
Loading...
Searching...
No Matches
MainMenuManager Class Reference

Manages the main menu and settings UI, including scene transitions, graphics and audio settings, and PlayerPrefs persistence. More...

Public Member Functions

void StartGame ()
 Starts the game by loading the loading screen or game scene.
 
void QuitGame ()
 Quits the application or stops play mode if in the Unity Editor.
 
void LoadSettingsScene ()
 Loads the settings scene from the main menu.
 
void BackToMenu ()
 Returns to the main menu scene.
 
void SetGraphicsQuality (int index)
 Sets the graphics quality based on dropdown index and saves it to PlayerPrefs.
 
void SetFullscreen (int dropdownIndex)
 Sets fullscreen or windowed mode based on dropdown index and saves it.
 
void SetMasterVolume (float volume)
 Sets the master audio volume and saves it.
 
void SetMusicVolume (float volume)
 Sets the music volume and saves it.
 
void LoadSettings ()
 Loads settings from PlayerPrefs and applies them to the UI and game.
 
void ResetToDefaults ()
 Resets all settings to default values and saves them.
 

Public Attributes

TMP_Dropdown graphicsDropdown
 Dropdown for selecting graphics quality level.
 
TMP_Dropdown fullscreenDropdown
 Dropdown for selecting fullscreen mode (0 = fullscreen, 1 = windowed).
 
Slider masterVolumeSlider
 Slider for controlling the master audio volume.
 
Slider musicVolumeSlider
 Slider for controlling the music volume.
 
string LoadingscreenSceneName = "LoadingScene"
 Name of the scene that serves as a loading screen or transition to gameplay.
 
string mainMenuSceneName = "MainMenu"
 Name of the main menu scene.
 
string settingsSceneName = "Settings"
 Name of the settings menu scene.
 

Detailed Description

Manages the main menu and settings UI, including scene transitions, graphics and audio settings, and PlayerPrefs persistence.

Member Function Documentation

◆ BackToMenu()

void MainMenuManager.BackToMenu ( )

Returns to the main menu scene.

◆ LoadSettings()

void MainMenuManager.LoadSettings ( )

Loads settings from PlayerPrefs and applies them to the UI and game.

◆ LoadSettingsScene()

void MainMenuManager.LoadSettingsScene ( )

Loads the settings scene from the main menu.

◆ QuitGame()

void MainMenuManager.QuitGame ( )

Quits the application or stops play mode if in the Unity Editor.

◆ ResetToDefaults()

void MainMenuManager.ResetToDefaults ( )

Resets all settings to default values and saves them.

◆ SetFullscreen()

void MainMenuManager.SetFullscreen ( int  dropdownIndex)

Sets fullscreen or windowed mode based on dropdown index and saves it.

Parameters
dropdownIndex0 for fullscreen, 1 for windowed.

◆ SetGraphicsQuality()

void MainMenuManager.SetGraphicsQuality ( int  index)

Sets the graphics quality based on dropdown index and saves it to PlayerPrefs.

Parameters
indexIndex of the graphics quality level.

◆ SetMasterVolume()

void MainMenuManager.SetMasterVolume ( float  volume)

Sets the master audio volume and saves it.

Parameters
volumeVolume level between 0.0 and 1.0.

◆ SetMusicVolume()

void MainMenuManager.SetMusicVolume ( float  volume)

Sets the music volume and saves it.

Parameters
volumeMusic volume level between 0.0 and 1.0.

◆ StartGame()

void MainMenuManager.StartGame ( )

Starts the game by loading the loading screen or game scene.

Member Data Documentation

◆ fullscreenDropdown

TMP_Dropdown MainMenuManager.fullscreenDropdown

Dropdown for selecting fullscreen mode (0 = fullscreen, 1 = windowed).

◆ graphicsDropdown

TMP_Dropdown MainMenuManager.graphicsDropdown

Dropdown for selecting graphics quality level.

◆ LoadingscreenSceneName

string MainMenuManager.LoadingscreenSceneName = "LoadingScene"

Name of the scene that serves as a loading screen or transition to gameplay.

◆ mainMenuSceneName

string MainMenuManager.mainMenuSceneName = "MainMenu"

Name of the main menu scene.

◆ masterVolumeSlider

Slider MainMenuManager.masterVolumeSlider

Slider for controlling the master audio volume.

◆ musicVolumeSlider

Slider MainMenuManager.musicVolumeSlider

Slider for controlling the music volume.

◆ settingsSceneName

string MainMenuManager.settingsSceneName = "Settings"

Name of the settings menu scene.


The documentation for this class was generated from the following file: