There are many times during development you may want to see how your game will appear if you build it outside 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 development kit.
No matter what platform we wish to create out game for in order to build it we need to go to the Build Settings menu.
In order to access Build Settings, we will need to go to File | Build Settings from the top menu (or by pressing Ctrl + Shift + B).
Once you're ready, select Platform from the bottom-left menu. The Unity logo will show the one you're currently compiling for. We're going to compile for Windows now, so if it is currently not set to PC, Mac & Linux Standalone, select it and press the Switch Platform button.
Once you have all of this set up, press the Build button. It will ask you for a name and a location to place the game. I'm going to name it FPSGame
and put it in an Export
folder located in the same...
Now that we know what happens by default, let's take some time to customize the project to make it look as nice as possible. PlayerSettings is where we can define different parameters for each platform that we want to put the game onto.
To open PlayerSettings, you can either click on the PlayerSettings button from the Build Settings menu or go to Edit | Project Settings | Player.
PlayerSettings is actually shown in Inspector. There are some key properties at the top that are cross-platform, which means that they will apply to all platforms (or rather will be the defaults you can override later).
From the Project tab, create a new folder within the MyGame
folder and name it Sprites
.
Now, in the Example Code
folder, you'll find a cursor_hand
image. Drag and drop it to the Assets/MyGame/Sprites
folder of the Project browser. Once there, select the image and change Texture Type to Cursor.
Note that, while the image I created works, you're more than welcome to create...
Like I mentioned previously, having a separate Data
folder with .exe
is somewhat of a pain. Rather than give people a .zip
file and hope they extract it all and keep everything in the same folder, I'd let the process be automatic and give the person an opportunity to install it just like a professional game. With this in mind, I'm going to go over a free way to create a Windows installer.
The first thing we need to do is to get our setup program. For our demonstration, I will be using Jordan Russell's Inno Setup installer. Go to http://jrsoftware.org/isinfo.php and click on the Download Inno Setup link.
Click on the Stable Release button and select the isetup-5.5.6.exe
file. Then, double-click on the executable to open it, click on the Run button if it shows a Security Warning dialog, and select Yes to allow changes.
In the Select Setup Language window, leave the selected language to English and click on OK.