ebook img

Unity Manual PDF

1012 Pages·2012·21.02 MB·English
by  
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Unity Manual

Unity Manual Welcome to Unity. Unity is made to empower users to create the best interactive entertainment or multimedia experience that they can. This manual is designed to help you learn how to use Unity, from basic to advanced techniques. It can be read from start to finish or used as a reference. The manual is divided into different sections. The first section, User Guide, is an introduction to Unity's interface, asset workflow, and the basics of building a game. If you are new to Unity, it is recommended that you start learning by reading the Unity Basics subsection. The iOS Guide addresses iOS specific topics such as iOS-specific scripting API, optimizations, and general platform development questions. The Android Guide addresses Android specific topics such as setting up the Android SDK and general development questions. The next section, FAQ, is a collection of frequently asked questions about performing common tasks that require a few steps. The last section, Advanced, addresses topics such as game optimization, shaders, file sizes, and deployment. When you're done reading, be sure to take a look at the Reference Manual and the Scripting Reference for further details about the different possibilities of constructing your games with Unity. If you find that any question you have is not answered in this manual please ask on Unity Answers or Unity Forums. You'll definitely find your answer there. Happy reading, The Unity team The Unity Manual Guide contains sections that apply onto to certain platforms. Please select which platforms you want to see. Platform- specific information can always be seen by clicking on the disclosure triangles on each page. Table of Contents  User Guide o Unity Basics  Learning the Interface  Customizing Your Workspace  Asset Workflow  Creating Scenes  Publishing Builds  Tutorials o Building Scenes  GameObjects  The GameObject-Component Relationship  Using Components  The Component-Script Relationship  Using the Inspector  Editing Value Properties  Assigning References  Inspector Options  Using the Scene View  Scene View Navigation  Positioning GameObjects  View Modes  Gizmos and Icons  Searching  Prefabs  Lights  Cameras  Particle Systems  Terrain Engine Guide o Asset Import and Creation  Importing Assets  Meshes  Animations  Materials and Shaders  Texture 2D  Procedural Materials  Movie Texture  Audio Files  Tracker Modules  Using Scripts  Asset Store  Accessing the Asset Store  Navigating the Asset Store  Managing previous downloads and purchases  Asset Server Guide  Behind the Scenes o Creating Gameplay  Instantiating Prefabs at runtime  Input  Transforms  Physics  Animation View Guide  Animation Scripting  Sound  Game Interface Elements  Networked Multiplayer  Getting Started with iOS Development o Unity iOS Basics o Unity Remote o iOS Scripting  Input  Mobile Keyboard  Advanced Unity Mobile Scripting  Using .NET API 2.0 compatibility level o iOS Hardware Guide o Optimizing Performance in iOS.  Optimizing Graphics Performance  Draw Call Batching  Modeling Optimized Characters  Rendering Statistics Window  Optimizing Physics Performance  Optimizing Script Performance  Measuring Performance with the Built-in Profiler  Tuning Main Loop Performance  Optimizing iOS Players build Size o Account Setup o Features currently not supported by Unity iOS o Plugins - Pro/Mobile-Only Feature o Preparing your application for "In App Purchases" o Customizing your Mobile target's Splash screen o Trouble Shooting o Reporting crash bugs on iOS  Getting Started with Android Development o Android SDK Setup o Android Remote o Trouble Shooting o Reporting crash bugs under Android o Features currently not supported by Unity Android o Player Settings o Android Scripting  Input  Mobile Keyboard  Advanced Unity Mobile Scripting  Using .NET API 2.0 compatibility level o Plugins - Pro/Mobile-Only Feature o Customizing your Mobile target's Splash screen o Devices That we Have Tested On o Integrating Unity with Eclipse  Launching an Android application from within unity  FAQ o Upgrading your Unity Projects from 2.x to 3.x  Physics upgrade details  Mono Upgrade Details  Rendering upgrade details  Unity 3.x Shader Conversion Guide o What's New in Unity? o Activation o Game Code Questions  How to make a simple first person walkthrough o Graphics Questions  How do I Import Alpha Textures?  How do I Use Normal Maps?  How do I use Detail Textures?  How do I Make a Cubemap Texture?  How do I Make a Skybox?  How do I make a Mesh Particle Emitter?  How do I make a Splash Screen?  How do I make a Spot Light Cookie?  How do I fix the rotation of an imported model?  How do I use Water? o FBX export guide o How do I import objects from my 3D app?  Importing Objects From Maya  Importing Objects From Cinema 4D  Importing Objects From 3D Studio Max  Importing Objects From Cheetah3D  Importing Objects From Modo  Importing Objects From Lightwave  Importing Objects From Blender o Workflow Questions  Getting started with Mono Develop  How do I reuse assets between projects?  How do I install or upgrade Standard Assets?  Advanced o AssetBundles (Pro only) o AssetDatabase o Rendering Paths o Profiler (Pro only) o Lightmapping Quickstart  Lightmapping In-Depth  Custom Beast Settings  Lightmapping UVs o Occlusion Culling o Loading Resources at Runtime o Modifying Source Assets Through Scripting o Generating Mesh Geometry Procedurally  Anatomy of a Mesh  Using the Mesh Class  Example: Creating a Billboard Plane o Execution Order o Optimizing Graphics Performance  Modeling Optimized Characters  Rendering Statistics Window o Reducing File Size o Platform Dependent Compilation o Debugging  Console  Debugger  Log Files  Accessing hidden folders o Plugins - Pro/Mobile-Only Feature o Command line arguments o Shaders  Shaders: ShaderLab & Fixed Function shaders  Shaders: Vertex and Fragment Programs o Graphics Emulation o Network Emulation o Security Sandbox of the Webplayer o Overview of available .NET Class Libraries o Visual Studio C# Integration o Using External Version Control Systems with Unity o Analytics o Check For Updates o Trouble Shooting  IME in Unity  Shadows in Unity o Directional Shadow Details o Troubleshooting Shadows o Shadow Size Computation o Optimizing for integrated graphics cards  Web Player Streaming  Web Player Deployment o HTML code to load Unity content o Working with UnityObject o Customizing the Unity Web Player loading screen o Customizing the Unity Web Player's Behavior o Unity Web Player and browser communication o Using web player templates Page last updated: 2011-07-09 User Guide This section of the Manual is focused on the features and functions of Unity. It discusses the interface, core Unity building blocks, asset workflow, and basic gameplay creation. By the time you are done reading the user guide, you will have a solid understanding of how to use Unity to put together an interactive scene and publish it. We recommend that new users begin by reading the Unity Basics section.  Unity Basics o Learning the Interface o Customizing Your Workspace o Asset Workflow o Creating Scenes o Publishing Builds o Tutorials  Building Scenes o GameObjects  The GameObject-Component Relationship  Using Components  The Component-Script Relationship o Using the Inspector  Editing Value Properties  Assigning References  Inspector Options o Using the Scene View  Scene View Navigation  Positioning GameObjects  View Modes  Gizmos and Icons o Searching o Prefabs o Lights o Cameras o Particle Systems o Terrain Engine Guide  Asset Import and Creation o Importing Assets o Meshes o Animations o Materials and Shaders o Texture 2D o Procedural Materials o Movie Texture o Audio Files  Tracker Modules o Using Scripts o Asset Store  Accessing the Asset Store  Navigating the Asset Store  Managing previous downloads and purchases o Asset Server Guide o Behind the Scenes  Creating Gameplay o Instantiating Prefabs at runtime o Input o Transforms o Physics o Animation View Guide o Animation Scripting o Sound o Game Interface Elements o Networked Multiplayer Page last updated: 2010-09-09 Unity Basics This section is your key to getting started with Unity. It will explain the Unity interface, menu items, using assets, creating scenes, and publishing builds. When you are finished reading this section, you will understand how Unity works, how to use it effectively, and the steps to put a basic game together. Learning the Interface There is a lot to learn, so take the time you need to observe and understand the interface. We will walk through each interface element together. Asset Workflow Here we'll explain the steps to use a single asset with Unity. These steps are general and are meant only as an overview for basic actions. Creating Scenes Scenes contain the objects of your game. In each Scene, you will place your environments, obstacles, and decorations, designing and building your game in pieces. Publishing Builds At any time while you are creating your game, you might want to see how it looks when you build and run it outside of the editor as a standalone or web player. This section will explain how to access the Build Settings and how to create different builds of your games. Tutorials These online tutorials will let you work with Unity while you follow along, providing hands-on experience with building real projects. Page last updated: 2010-09-10 Learning the Interface First Launch Let's begin learning Unity. If you have not yet opened Unity, you can find it inside Start->Programs->Unity on Windows, or Applications- >Unity on Mac. The Unity Editor will appear. Take your time to look over the Unity Editor interface and familiarize yourself with it. The Main Editor Window is made up of several Tabbed Windows, called Views. There are several types of Views in Unity, each with a specific purpose. Project View Every Unity project contains an Assets folder. The contents of this folder are presented in the Project View. This is where you store all the assets that make up your game, like scenes, scripts, 3D models, textures, audio files, and Prefabs. If you right-click on any asset in the Project View, you can choose Reveal in Explorer (Reveal in Finder on Mac) to actually see the asset itself in your file system. Important Note: You should never move project assets around using the OS since this will break any metadata associated with the asset. Always use the Project View to organize your assets. To add assets to your project, you can drag any file from your OS into the Project View, or use Assets->Import New Asset. Your asset is now ready to be used in your game. For more information about working with assets, skip ahead to the Asset Workflow section of the manual. Scenes are also stored in the Project View. Think of these as individual levels. For example, the Islands Scene loads by default when Unity first launches. To create a new Scene, use Control-N (Command-N on Mac). To save the current Scene into the Project View, use Control-S (Command-S on Mac). Some game assets need to be created from within Unity. To do this, use the Create drop-down, or right click->Create. The Create drop-down This will allow you to add scripts, Prefabs, or folders to keep your project organized. You can rename any asset/folder by pressing F2 on Windows, or Enter on Mac, or with two paced clicks on the asset name. If you hold the Alt key while you expand or contract a directory, all subdirectories will also be expanded or contracted. Hierarchy The Hierarchy contains every GameObject in the current Scene. Some of these are direct instances of asset files like 3D models, and others are instances of Prefabs -- custom objects that will make up much of your game. You can select and Parent objects in the Hierarchy. As objects are added and removed from the scene, they will appear and disappear from the Hierarchy as well. Parenting Unity uses a concept called Parenting. To make any GameObject the child of another, drag the desired child onto the desired parent in the Hierarchy. A child will inherit the movement and rotation of its parent. You can now expand and contract the parent to see its children in the Hierarchy without affecting your game. Two unparented objects One object parented to another To learn more about Parenting, please review the Parenting section of the Transform Component page. Toolbar The Toolbar consists of five basic controls. Each relate to different parts of the Editor. Transform Tools -- used with the Scene View Transform Gizmo Toggles -- affect the Scene View display Play/Pause/Step Buttons -- used with the Game View Layers Drop-down -- controls which objects are displayed in Scene View Layout Drop-down -- controls arrangement of all Views Scene View The Scene View The Scene View is your interactive sandbox. You will use the Scene View to select and position environments, the player, the camera, enemies, and all other GameObjects. Maneuvering and manipulating objects within the Scene View are some of the most important functions in Unity, so it's important to be able to do them quickly. Scene View Navigation See Scene View Navigation for full details on navigating the scene view. Here's a brief overview of the essentials:  Hold the right mouse button to enter Flythrough mode. This turns your mouse and WASD keys (plus Q and E for up and down) into quick first-person view navigation.  Select any GameObject and press the F key. This will center the Scene View and pivot point on the selection.  Use the arrow keys to move around on the X/Z plane.  Hold Alt and click-drag to orbit the camera around the current pivot point.  Hold Alt and middle click-drag to drag the Scene View camera around.  Hold Alt and right click-drag to zoom the Scene View. This is the same as scrolling with your mouse wheel. You might also find use in the Hand Tool (shortcut: Q), especially if you are using a one-button mouse. With the Hand tool is selected, Click-drag to drag the camera around. Hold Alt and click-drag to orbit the camera around the current pivot point. Hold Control (Command on Mac) and click-drag to zoom the camera. In the upper-right corner of the Scene View is the Scene Gizmo. This displays the Scene Camera's current orientation, and allows you to quickly modify the viewing angle. You can click on any of the arms to snap the Scene Camera to that direction and change it to Isometric Mode. While in Isometric Mode, you can right-click drag to orbit, and Alt-click drag to pan. To exit this mode, click the middle of the Scene Gizmo. You can also Shift-click the middle of the Scene Gizmo any time to toggle Isometric Mode. Positioning GameObjects See Positioning GameObjects for full details on positioning GameObjects in the scene. Here's a brief overview of the essentials: When building your games, you'll place lots of different objects in your game world. To do this use the Transform Tools in the Toolbar to Translate, Rotate, and Scale individual GameObjects. Each has a corresponding Gizmo that appears around the selected GameObject in the Scene View. You can use the mouse and manipulate any Gizmo axis to alter the Transform Component of the GameObject, or you can type values directly into the number fields of the Transform Component in the Inspector. Scene View Control Bar The Scene View control bar lets you see the scene in various view modes - Textured, Wireframe, RGB, Overdraw, and many others. It will also enable you to see (and hear) in-game lighting, game elements, and sound in the Scene View. See View Modes for all the details. Game View The Game View is rendered from the Camera(s) in your game. It is representative of your final, published game. You will need to use one or more Cameras to control what the player actually sees when they are playing your game. For more information about Cameras, please view the Camera Component page. Play Mode Use the buttons in the Toolbar to control the Editor Play Mode and see how your published game will play. While in Play mode, any changes you make are temporary, and will be reset when you exit Play mode. The Editor UI will darken to remind you of this. Game View Control Bar The first drop-down on the Game View control bar is the Aspect Drop-down. Here, you can force the aspect ratio of the Game View window to different values. It can be used to test how your game will look on monitors with different aspect ratios. Further to the right is the Maximize on Play toggle. While enabled, the Game View will maximize itself to 100% of your Editor Window for a nice full-screen preview when you enter Play mode. Continuing to the right is the Gizmos toggle. While enabled, all Gizmos that appear in Scene View will also be drawn in Game View. This includes Gizmos drawn using any of the Gizmos class functions. Finally we have the Stats button. This shows Rendering Statistics window that is very useful for Optimizing Graphics Performance. Game View Stats of your game. Inspector Games in Unity are made up of multiple GameObjects that contain meshes, scripts, sounds, or other graphical elements like Lights. The Inspector displays detailed information about your currently selected GameObject, including all attached Components and their properties. Here, you modify the functionality of GameObjects in your scene. You can read more about the GameObject-Component relationship, as it is very important to understand. Any property that is displayed in the Inspector can be directly modified. Even script variables can be changed without modifying the script itself. You can use the Inspector to change variables at runtime to experiment and find the magic gameplay for your game. In a script, if you define a public variable of an object type (like GameObject or Transform), you can drag and drop a GameObject or Prefab into the Inspector to make the assignment. Click the question mark beside any Component name in the Inspector to load its Component Reference page. Please view the Component Reference for a complete and detailed guide to all of Unity's Components. Add Components from the Component menu You can click the tiny gear icon (or right-click the Component name) to bring up a context menu for the specific Component.

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.