Dynamic Main Menu in Unity

Objective: An overview of a dynamic main menu created using Timeline in Unity HDRP. (Includes interactive sounds, and animations made via Timeline)
Table of Contents
· The Environment
· Menu Options
· Updated Version: Less code, more Event Systems (Best approach!)
∘ New Code:
I’ve always loved main menus that give the player a beautiful open environmental view. One of my favorite examples is from Jedi: Survivor — a breathtaking view Coruscant greets the player, bustling air traffic decorates the skies and the menu options are minimalistic and out of the way so as not to distract you from the landscape.

I was inspired to create my dynamic main menu with interactive sounds and animated details, such as aircraft hovering in the distance. Much of this project is inspired by Star Wars, and it has been a joy to express my creativity through it.

The Environment
I started by creating a scene using HDRI Skies in Unity HDRP and some high-quality game assets to set up a tower. Using the power of the high-definition render pipeline, I added some post-processing, fog, dust particles, and complimentary blue lighting.

With the setpiece complete, I brought the Player(spaceship) into the scene and added it as a centerpiece, ensuring the blue light accentuates the metallic texture.

Menu Options
I wanted to keep things minimalistic and out of the way to bring attention to the environment design, as such, I anchored the options to the lower left side of the screen.

To make the menu more responsive, I added some interactive sounds and color changes that react when the options are hovered over and selected.
Each sound is set in the Inspector via Seraliezed Fields from the code.

Here is the full Main Menu Code:

Updated Version: Less code, more Event Systems
A simplified version of this Main Menu can be easily achieved via Unity’s Event System by adding a UI Button Text Mesh Pro.

These handy little buttons come equipped with an Event System readily available for use, all you need are public functions to get the desired behaviors. My code has been substantially reduced as a result.
New Code:

Code Key Features: All I need is to be able to start my game , display controls, and play sounds as a response to input interaction when the options are selected or hovered over. Every function is made public so that the event system can access it.
I no longer need to change the colors via code since this is all intuitively handled by visually appealing options in the Inspector.

Then, all I need to do is go to the respective Button Text Mesh Pro element in my Inspector and add the event. This is done by dragging and dropping the object that has the attached script and then searching through the list of functions available.

To get the Hover Over Color Changes and Sound, I added new Event Triggers.

With the New Event Type set to PointerEnter, it registers when the mouse hovers over the options. This must be done per option.

With all my event types set, I can access the functions in my code and have an awesome interactive Main Menu!

The Updated Result
I added some more animations as well, looks even better now! I will be adding music to all my scenes once I initiate the finishing touches stage of the project.
That concludes today’s overview! For this project, my documentation is more summarized, but I will return to my more detailed article format later. Check out my portfolio, I am currently looking for opportunities!