Objective: Learn how to quit an application using the Escape key in Unity

Unity has a built-in quit application function.

In the GameManager script’s Update function add the following code:

Now you can exit the game on key press when in full screen mode.

--

--

Objective: Learn how to deploy the completed game for web gameplay

Go to Build Settings, select WebGL and then click on Switch Platform. Unity will recompile the project for a WebGL environment. Development Build allows us to do debugging. First, you need to fix the Color Space in the Player Settings then go to Other Settings. Change Linear to Gamma and let the project compile. Create a folder to place the compiled project files in. You can host a WebGL project on your web server or use GameDevHQ’s web server.

--

--

Objective: Learn how to play Audio Clips from script in Unity

Click on the Player in the Hierarchy and add an Audio Source, assign the clip you want to play and set Play On Awake to false. Go to the Player script and initialize the Audio Clip and Audio Source as private serialized fields. Then, assign them in the Inspector. But, you should also null check in case the component can’t be found so the game doesn’t crash. In the script, play the _audioSource from the FireLaser method be calling _audioSource.Play(). Finally, in the Inspector, turn the volume of the Background music down so that you can hear the sound effects.

--

--

Objective: Learn how to add audio effects to a game in Unity

To add background music, create a new empty GameObject and name it ‘Audio_Manager’. Create and nest a new empty GameObject within the Audio_Manager and name it ‘Background’. Add the Audio Source component to the Background GameObject to play an audio clip. Attach the music_background AudioClip to the Audio Source component. Check the Play On Awake and Loop boxes.

--

--

Objective: Lean how to install the post processing package in Unity.

Post processing allows us to apply image effects and filters to our games. Install it from the Package Manager, the Package Manager contains Unity-owned and maintained products. Go to Window, then Package Manager and select the Post Processing package.

--

--

KW Development LLC

KW Development LLC

7 Followers

Seasoned, result-oriented, highly professional individual with a stellar record of expertise in back-end development and game development.