THE THOUGHT CATALOGUE

This post notes the code you need to write to create your Start and Exit scenes for your game. The concept is simple. You'll need to attach buttons for every action, and link them via script. When clicked, the buttons need to open different scenes. For the Quit button, you need to quit the application.To start, create both scenes and add your buttons. The image below is a very basic example of an exit scene with two buttons placed together in a panel (UI).

To write your exit script, create an empty object and attach a new script to it, your quitting script. For this script, remove Start() and Update() functions, and add your own function to quit the application:

Inside your function, use the Application.Quit() method, which will close the game.Click on your button in Scene mode, and in the OnClick section, click on + and choose the empty object earlier having the script attached. Next to it, choose your exit script and your exit function. The OnClick section should look like the image shown to the left, with the exit.QuitGame function selected.

Do the same thing for your start scene. For the start scene, you need to use the SceneManager.LoadScene() method to change scenes. You need to import the UnityEngine.SceneManagement library. As before, remove all functions, and add your own function. In this case, it is LevelManager(name), with name being an argument for the scene you want to switch to.

Create a new object in the Start scene and attach this script to it. Again, add a reference to this function in the OnClick section of your button. In the text box appearing below your chosen function, enter the name of your scene. An example is shown to the left. In the text box, the word "Start" refers to a scene named "Start". Upon clicking the button, Unity will take you to this scene.

This post is meant for all those who have a Github repository containing the code for a website, and have purchased a domain name via GoDaddy, but not the hosting, and want to use the hosting of Github Pages to serve their website. Or in other words, host your website for free using Github Pages.

The post shows how to link your Github Project Repository to a domain you purchased on GoDaddy. Essentially, this means that if you visit your GoDaddy domain, you will see the code of the Github Repository as shown on its gh-pages site, but with your own domain. Although the demonstration is for GoDaddy, the steps below can be applied to any other web registrar as well.