Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Unity 5.x By Example

You're reading from   Unity 5.x By Example An example-based practical guide to get you up and running with Unity 5.x

Arrow left icon
Product type Paperback
Published in Mar 2016
Publisher Packt
ISBN-13 9781785888380
Length 402 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Alan Thorn Alan Thorn
Author Profile Icon Alan Thorn
Alan Thorn
Arrow right icon
View More author details
Toc

Table of Contents (10) Chapters Close

Preface 1. The Coin Collection Game – Part 1 FREE CHAPTER 2. Project A – the Collection Game Continued 3. Project B – the Space Shooter 4. Continuing the Space Shooter 5. Project C – a 2D Adventure 6. Continuing the 2D Adventure 7. Project D – Intelligent Enemies 8. Continuing with Intelligent Enemies Index

Importing assets

Assets are the raw materials for games—the building blocks from which they're made. Assets include meshes (or 3D models), such as characters, props, trees, houses, and more: textures, which are image files such as JPEGs and PNGs (these determine how the surface of a mesh should look); music and sound effects to enhance the realism and atmosphere of your game, and finally, scenes, which are 3D spaces or worlds where meshes, textures, sounds, and music live, exist, and work together holistically as part of a single system. Thus, games cannot exist without assets—they would otherwise look completely empty and lifeless. For this reason, we'll need assets to make the coin collection game we're working toward. After all, we'll need an environment to walk around and coins to collect!

Unity, however, is a game engine and not an asset creation program. This means that assets, such as characters and props, are typically made first by artists in external, third-party software. From here, they are exported and transferred ready-made to Unity, and Unity is responsible only for bringing these assets to life in a coherent game that can be played. Third-party asset creation programs include Blender (which is free of charge), Maya or 3DS Max to make 3D models, Photoshop or GIMP (which is free of charge) to create textures, and Audacity (which is free of cost) to generate audio. There are plenty of other options too. The details of these programs are beyond the scope of this book. In any case, Unity assumes that you already have assets ready to import to build a game. For the coin collection game, we'll use assets that ship with Unity. So let's import these to our project. To do this, select Assets | Import Package from the application menu. Then select Characters, ParticleSystems, Environment, and Prototyping. See Figure 1.9:

Importing assets

Figure 1.9: Importing assets via the Import Package menu

Each time you import a package from the menu, you'll be presented with an Import dialog. Simply leave all settings at their defaults, and click on Import. See Figure 1.10:

Importing assets

Figure 1.10: Choosing Assets to import

By default, Unity decompresses all files from the package (a library of assets) into the current project. After importing, lots of different assets and data will have been added to the Project, ready for use. These files are copies of the originals. So any changes made to the imported files will not affect or invalidate the originals, which Unity maintains internally. The files include models, sounds, textures, and more. These are listed in the Unity Editor from the Project panel. See the following screenshot:

Importing assets

Figure 1.11: Browsing imported assets from the Project panel

Tip

When selecting Assets | Import from the application menu, if you don't see all, or any, asset packages listed, you can download and install them separately from the Unity website at https://unity3d.com/. From the downloads page, choose the Additional Downloads option, and then select the Standard Assets package. See Figure 1.12.

Importing assets

Figure 1.12: Downloading the Standard Assets package

The imported assets don't exist yet in our game. They don't appear on screen, and they won't do anything yet! Rather, they're simply added to the Project panel, which behaves as a library or repository of assets, from which we can pick and choose to build up a game. The assets imported thus far are built-in into Unity and we'll be continually using them in subsequent sections to make a functional coin collection game. To get more information about each asset, you can select the asset by clicking on it with the mouse, and asset-specific details will be shown on the right-hand side of the Unity Editor in the Inspector. The Inspector is a property sheet editor that appears on the right-hand side of the interface. It is context-sensitive and always changes to display properties for the selected object. See Figure 1.13.

Importing assets

Figure 1.13: The Inspector displays all the properties for the currently selected object

You have been reading a chapter from
Unity 5.x By Example
Published in: Mar 2016
Publisher: Packt
ISBN-13: 9781785888380
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image