Monday, 26 May 2014

Loading Levels

I've created a script where you are able to load different levels of churches. How it works is where a button will be set up in the scene (as a game object) and a script will be attached to it that loads a level in response to clicking it. This Loading levels script is needed to load different churches and the future aspect of adding more churches to the game.

The above script is for the button that will load a specific level when clicked on.

An example set-up of the buttons linked to different church levels

and the result of what happens when you click on the button.

Also this script is used to save a church level that will be used from the script used for the button, so that it'll know which level to load. In addition, by working with multiple levels, the different levels has to be added to the build settings, else Unity wouldn't be find the level as well.

No comments:

Post a Comment