now that we have a game with a build , we will want to be able to quit it. this is done through “Application.Quit” the code can look like this:
I added the debug log in there so you can see it is recognised within the console as you can not quit while testing within unity.
Just like before within building settings we want to select “WebGL” and we want to “switch platform” to rebuild our project so that it can be built
Once this is done the Unity symbol will be next to the appropriate platform. We then want to resolve the warning related to the colour spacing within the build. You can find this within the player settings > Player > Other Settings Colour Space, this needs to be chnaged to Gamma for WebGL.
Now that all the main elements of the game are finished we can turn our game into executable file to test. This is done through the build settings under file.
Within the player settings we can adjust whether it is windowed or full screen. Under play settings we can also adjust the type of full screen mode you would like. Once all settings are set you can run the exe. very simple and you can see all the platform you are able to use. Just have to have that module installed.
Lets start by adding an empty object and naming it Audio Manger. Then adding a child to it called background.
to the background we will add a component called “Audio Source” this communicates with the Main cameras component called “Audio Listener”
With the Post process volume Profile set we can now add our effects.
From the list I have added Bloom and Color grading
To add Post processing to our game we need to install it from the Package manager which we can find in the window tab.
To then get started we will want to add an empty GameObject that will define our profile that will control all the effects that we want to apply to our project. Then add the component “Post Process Volume”
When building a game in unity it is done in a modular way. At the moment with our space shooter we have been working with one scene. If the game ends we would want to reload that scene, here's how:
Like the Game over text we will add some more text to read “Press the ‘R’ key to restart the level”
Create an empty object called “Game_Manger” and attach a C# script to also called “GameManager” Unity will recognise this and change the logo to a cog.
Aspiring Unity Developer