While going through unity forums i have got to know that many people wanted to have a proper solution for pausing their games. In order to help them especially new bies i have made a package viz., MenuPackage.
It has a splash scene, a menu scene and a play again scene. It would help to know how to create a menu for the game. It would also help you to reuse it multiple times in your game(just in the developing phase).
The pause game and loadsettings scripts can be used with just any scene by just dragging and dropping.
The procedure for how to use this package is explained in the file with the attachment.
MenuPackage
You can find a WebDemo implementing this package here:
Working Web Demo
Downloadable Web Demo
Hope this package would help people out here.
According to me there can be some FAQs related to this package. So here are a few of them:
Q1. I got stuck at the splash scene. What to do?
or
I am getting an error saying Level MenuScene couldn’t be loaded.
Ans. You have not set all the scenes in your build settings. Apply the scenes in the build settings of your project in the mentioned order.
Q2. There is a field viz. background in the pauseGame and loadSettings script. What is its use?
Ans. The field represents the gameObject containing your background music. When user wants to put the music off from pause menu or from the main menu it must not get started when the level loads. So in order to achieve this functionality do the following procedure:
a) Uncheck Play On Awake property from the AudioSource having your background music
b) Assign this gameObject to the “background” field of the said scripts.
Q3. Where do i have to apply pauseGame and loadsettings?
Ans. You should apply these two scripts on an empty gameObject in your scene.
Any suggestions or questions are welcome.
Now you can easily use this package with EZGUI, the pauseScript has been simplified into functions which can easily be used EZGUI buttons and controls by just providing the name of the function and the gameObject containing that script.
The package also demonstrates how to fade in and out while switching from one scene to another.
Another new feature has been added to the package. You could implement a scrolling level box like the one you see in games like Angry Birds, Cut the Rope, etc.