top of page

Menu Mini-Project

MainMenu.png
OptionsMenu.png

In this mini-project, a menu was created that can be applied to a multitude of games. There is a main menu with play, options and quit buttons, along with an options menus which allows for the volume of the game to be adjusted.

PlayGameCode.png

The code snippet to the left shows what happens when the Play button is pressed. The game is loaded by loading the next active scene using SceneManager.

The code snippet to the right shows what happens when the Quit button is pressed. The application is quit (of course in the web browser the application can not be quit).

QuitGameCode.png

Menu Mini-Project

VolumeCode.png

The code snippet to the left shows how the volume is adjusted. An AudioMixer is used and the audio is scaled based on the value of the AudioMixer.

Text Mesh Pro was used for this project in order to improve the quality and richness of the text on the menu screen. The Text Mesh Pro GUI for the Play button is shown to the right.

TextMeshPro.png
Options_BackButton.png

The image to the left shows how the Options and Back buttons functioned. When they were clicked, they would set the current screen to inactive and the inactive screen to active, thus switching to the other scene.

The image to the right shows how the PlayGame function was executed. It was attached as an OnClick action to the Play button. This is also how the Quit function was executed.

PlayButton.png
ExposeVolume.png

In the inspector, the Volume of Master was exposed to the script to allow for the adjustment of the volume levels with the volume slider by right clicking on Master in the Inspector as seen in the image on the right.

bottom of page