OUYA Game Development by Example
上QQ阅读APP看书,第一时间看更新

Time for action – setting up Unity

You'll be spending most of your time throughout the course of this book working in the Unity environment, so it's important to get it set up correctly and acclimate yourself with every element of the workspace layout. Perform the following steps to set up Unity:

  1. To begin installing Unity, download the installer from http://unity3d.com/ by clicking on the Download tab.
  2. Once the download completes, run the installer. It may prompt you with some optional packages to install, including an example project, a web player, and a code editor called MonoDevelop.

    The example project and web player aren't necessary as they apply to non-OUYA games, so you can leave them checked or un-check them depending on whether or not you want to explore games on other platforms. However, you'll want to leave MonoDevelop checked, as shown in the following screenshot:

    Time for action – setting up Unity

    If you're using Windows and already use Visual Studio for coding projects, you can also configure Unity to use that as your primary editor in Unity's Preferences… menu. Open it from the Edit menu, select the External Tools tab, and select your installed version of Visual Studio from the drop-down list labeled External Script Editor.

    Now that you've got Unity installed, let's take a look at the interface.

  3. Start up Unity and click on New Project under the File menu to choose a place for your first project; for now, just use the default settings because you're only looking around.

    Note

    The first time you start Unity, it will prompt you to create a Unity account and choose between the free version of Unity and Unity Pro. Purchasing a Unity Pro license adds several additional features, but you won't need anything more than the free version when it comes to the material in this book.

    Unity features several different preset layouts that you can play with to get your workspace exactly how you like it. In the examples in this book, we'll be using the 2 by 3 layout.

  4. To change Unity's layout, open the Window menu from the top toolbar and open the Layouts submenu. Choose the 2 by 3 option and Unity should rearrange itself to look like the following screenshot:
    Time for action – setting up Unity

    The two stacked windows on the left half of the application are the Game and Scene windows. The Game window will display your game through your main camera, as it will appear to the player. The Scene window is a 3D environment that you can move around and view from any angle, and will allow you to interact with the 3D objects in your game.

    The three tabs on the right half of your layout are the Hierarchy, Project, and Inspector windows. The Hierarchy menu displays all Unity game objects present in the scene, the Project menu enables you to navigate your assets so that you can add them to the scene, and the Inspector menu lets you change individual properties of a single highlighted object in the Hierarchy or Project tab. Right now, you don't have any assets, but you have one game object in your Hierarchy menu: Main Camera. Each empty project will start with this default main camera so it has something to display on the screen, because every game needs at least one camera for the player to view the world through.

What just happened?

You've successfully installed Unity, but it doesn't come ready to develop for OUYA out of the box; next you'll need to link the engine to various packages and dependencies that OUYA uses to communicate with Unity.