Finding Your Way Around

Một phần của tài liệu Game Development for iOS with Unity3D 2012 (Trang 79 - 83)

4. Basics of the Unity Editor 59

4.2 Finding Your Way Around

4.2.1 Scene View

The Scene View is where you will do most of your work on each scene of your game, such as rotating or positioning GameObjects (Figure 4.1). Unlike the Game window, the picture you see rendered by the Scene View is not specifically indicative of what

Figure 4.1. The Scene View of the Unity editor.

4.2. Finding Your Way Around 63

the final game will look like, and elements such as lighting or GUI may be turned on or off to allow for easier editing. The Scene View camera is set up for you to move around freely (using the keyboard shortcuts, the gizmo, or mouse and key combinations) and is intended to be used during the working process; that is, wherever you leave, it has no effect on the final game.

The top left of the Scene View provides a drop-down menu containing a number of different rendering options:

y Textured shows all meshes in the scene with textures on.

y Wireframe shows all meshes drawn in wireframe with no textures.

y Tex-Wire shows all meshes drawn in wireframe with textures.

y Render paths is supported by Unity for several different paths, but the only ones of interest to us, as mobile developers, are the Forward Rendering and Vertex Lit entries. There is a great section in the documentation provided with Unity explaining how these work.

y Lightmap resolution is used to represent the resolution of lightmapping. It should be used as a guide in estimating whether or not the resolution is correct.

The next drop-down menu at the top of the Scene View window is Render Modes. Its default setting is RGB (red, green, blue), and there are several other render modes available:

y RGB renders the scene normally.

y Alpha renders only alpha values in the scene for checking and tuning transpar- ency or effects using alpha.

y Overdraw renders the scene in wireframe, but with red rectangles representing how much of the screen is consuming overdraw time. The more overlap you see between the boxes, the more time is being spent by the engine rendering things that are not even in view. Occlusion culling (a Pro-only feature) will go some way to reducing this load in the actual game environment.

y Mipmaps show how mipmapping is affected by texture sizes. Red areas mean the textures are too big for mipmapping at that distance; blue areas mean a texture is too small. I don’t see it having much use for iOS development at the moment, as we need to keep textures as small as possible regardless of mip- mapping. That said, if you need to fine-tune mipmaps, this is probably a good place to visit.

To the right of the Render Modes drop-down are three buttons (Figure 4.2).

y Scene lighting toggles between the very basic, easy- to-see-everything default lighting setup and the game lighting setup (whatever lights you have in the

scene). Figure 4.2. Scene View buttons in the Uni-

ty editor.

y Game overlay toggles on or off some elements that are only normally shown in the game window, such as GUI elements or skyboxes, in the Scene View.

y Audition mode makes AudioSources play as though the game were playing.

This is great for testing out environmental sounds (such as background ma- chinery, bleeping computers, or perhaps ambient animal sounds like birds’

song) and making sure that they are positioned correctly in the environment to provide the intended effects.

4.2.2 Game View

When Unity is not in play mode, the Game View shows the view from whichever cam- era within the scene has the highest depth (Figure 4.3). When you hit play, the Game View changes to show what the player will see. You cannot navigate the scene through the Game View; this is your preview window into the game world, through its cameras only.

The Game View has a number of parameters and features to make your game de- velopment easier:

y Viewport aspect ratio. In the top left of the window of the Game View, you can select an aspect ratio for the viewport. The aspect ratio is the ratio of the view- port’s width to its height (for example, a 4:3 aspect ratio means that the width of the window will be four units to the height’s three—these units are arbitrary

Figure 4.3. The Game View window in the Unity editor.

4.2. Finding Your Way Around 65

at this point). Affecting the Game View aspect ratio does not affect the game camera or Game View in any way, and the settings here will only affect what you see on the screen during editing. Click on the Aspect Ratio drop-down to see the aspect ratios available to you. Notice that there are several platform- specific settings such as resolutions and ratios suitable for iOS development both in landscape and portrait orientations.

y Maximize on Play button. When this button is checked, the Game View view- port will stretch to fill the editor window whenever the editor enters play mode.

y Stats. The Stats window contains a host of very useful information. As an iOS developer, you will no doubt pay the most

attention to Draw calls, Tris, Verts, and VRAM usage.

y Gizmos. The Gizmos drop-down allows you to change the way in which gizmos are dis- played in the Game View viewport. Gizmos are iconic representations of game elements, such as lights, cameras, or custom icons for objects such as AI waypoints or proxy ob- jects. At the top of the drop-down, you can change the size that gizmos are drawn at;

moving down, you should see a list of avail- able gizmos. To toggle gizmos on or off, simply click on its icon to hide it or click the checkbox to hide or show the gizmo itself.

4.2.3 hierarchy View

The Hierarchy View includes all of a scene’s cameras, models, sounds, particle effects, and UI elements—

everything you use to make up a scene (Figure 4.4). It is shown in a Tree View–based style (text based, with children of objects shown as branches), although things are never too difficult to find in complex scenes, thanks to the handy search function.

You can create GameObjects for your scene by using the Create button at the top of the Hierarchy View. After clicking on Create, you are shown a list of the types of objects you can create. Click one of these and Unity adds the new object to your scene.

4.2.4 Project Window

The Project window has everything that makes up

your project: all of the materials, textures, meshes, Figure 4.4. The Hierarchy View in the Unity editor.

prefabs, animations, and just about any- thing else you can think of that might go into a Unity project. The Project window is your gateway to content, and you will find yourself spending a lot of time dragging things out of here and into your scenes.

4.2.5 Inspector Window

Whenever you select a GameObject, its properties will appear in the Inspector window (Figure 4.5). This window con- tains the selected objects’ properties, and you can easily modify values as per regular text input boxes for numeric val- ues or similar, well-established regular UI methods.

To alter numeric values quickly, Unity gives you the option to do this through a drag-and-drop method. Click on the text next to the numeric value and the icon changes to something resembling two ar- rows. Once you see this, you can hold and drag left or right to change the numeric value. Hold down the shift key as you drag to change values faster.

Một phần của tài liệu Game Development for iOS with Unity3D 2012 (Trang 79 - 83)

Tải bản đầy đủ (PDF)

(278 trang)