There are many times during development that you may want to see what your game looks like if you build it outside of the editor. It can give you a sense of accomplishment; I know, I felt that way the first time I pushed a build to a console devkit. Whether it's for PC, Mac, Linux, web player, mobile, or console, we all have to go through the same menu, the Build Settings menu. We perform the following steps:
Twinstick Shooter
project that we created back in Chapter 1, 2D Twin-stick Shooter, Chapter 2, Creating GUIs. Open up your main menu scene (in the example code, it is saved as Main_Menu
). Take a look at the following screenshot:TwinstickShooter
and put it in an Export
folder located in the same directory as the Assets
and Library
folder. Afterward, hit Save. Take a look at the following screenshot:When building for Windows, you should get something like the preceding screenshot. We have the executable, but we also have a data folder that contains all the assets for our application (right now called TwinstickShooter_Data
). You must include the data folder with your game, or it will not run. This is a slight pain, but later on in this chapter, we will create an installer so that we can put it on a computer without any hassle.
If you build for Mac, it will bundle the app and data all together, so once you export it, all you need to give people is the application.
If you are interested in submitting your Mac game to the Mac App Store, there is a nice tutorial about doing just that at http://www.conlanrios.com/2013/12/signing-unity-game-for-mac-app-store.html.
If you double-click on the .exe
file to run the game, you'll be brought to the following startup menu, as shown in the following screenshot:
This will allow players to customize their Screen Resolution values as well as other options, such as what buttons to use for input. I personally feel that this menu makes projects look more unprofessional, so I'll be teaching you how to remove this as well.
Anyway, once we click on the Play! button, we'll be taken to the proper game screen, as shown in the following screenshot:
And it's working great. We can work at any resolution that we choose, and all the menus are functioning as well!
For more information on publishing and specific things to look out for, check out the following link:http://docs.unity3d.com/Manual/PublishingBuilds.html