Music Selection
Summary
Tonight I was able to put together the first working version of the song selection within the options menu! I have been grooving to some great Lo-Fi beats while developing this game, so I thought it would be fitting to put a few Lo-Fi tracks as selections in the options menu. All songs for this game (so far) can be credited to Fesliyan Studios who have a catalog of royalty free music. Specifically, music that really is great also!
The hardest part of this integration was getting the buttons to stay selected after leaving the options screen. I was able to do this by leveraging a combination of a public float and the Unity.EventSystem to dynamically select the correct button when the options menu is loaded. Essentially, I when the button is selected in the menu the `musicIndex` float is updated based off the respective index of the song. Then that float is passed through as an argument when the options menu is opened and the EventSystem selects the button based on whatever the musicIndex float is.
The above took me longer than I would like, but glad I was able to get the system working! I think next I will try and find a few local artists to contribute their music to allow users to select from a variety of songs if they would like. Regardless I may be done with the UI for now and want to go back to adding more gameplay elements before release.