Today was a fun experience of trying to figure out how to adjust the volume and brightness of the game through a click on the button in an options menu in the game.
The volume adjustments was rather simple to figure out. First off, I got some buttons created for the volume settings:
Each of these buttons is then linked through an OnClick event with the button component to my scripts function:
One I figured this out, it was off the figure out how I can adjust the brightness of the game, and was it ever an adventure to get through. At the end of the day however, I finally found out the method needed to make it work like I wanted it to:
What I ended up doing for this is creating a script to attach to my post process object, and called upon the color grade settings like so:
What I ended up having to do was create a variable of ColorGrading and have it assigned within the PostVolume object through a GetSettings option. Next, I created it’s own method that has it’s values set by a float I assigned with the buttons upon clicking on them.
From here, I went back over to my main menu script and added in a method in which I could call that Lighting method:
Now that I have gotten the main menu set up, with working buttons and an options menu, it’s time to finish off all the smaller aspects of the game and build the boss unit.