Whatever your background, with the breadth and depth of topics covered you should find new features and techniques to enhance your next game. This book offers detailed, easy-to-follow, step-by-step recipes helping you master a wide range of Unity game features.
Chapters are provided focusing on the basics; audio, cameras, images, materials and animations, GUIs, external resources and devices, directional and artificial intelligence character control, and performance optimization. Work with cameras, images, and the Shuriken practical system, to create mini-maps, control zooming, and depth of field, and switch between cameras.
Define materials for reflections, transparency, specular and self-illumination of materials, and cloudy outdoor effects. Use artificial intelligence techniques to make non-player character objects seek, follow, flee each other, or follow a waypoint sequence, and even flock together like a herd of animals. Make your game communicate with Microsoft Kinect cameras, for control of game characters, and even to record your own motion capture.
Improve GUIS with real-time radars, custom mouse cursors, analogue and digital clocks, color section dialogs, mouse over material highlighting, graphical power-bars, and a flexible inventory class. Save and load text, XML, or media assets from local or remote sources, and communicate with websites and their databases to create online scoreboards Approach Cookbook.
Who this book is written for From beginners to advanced users, from artists to coders, this book is for you and everyone in your team!
This book is for anyone who wants to explore a wide range of Unity scripting and multimedia features and to find ready to use solutions to many game features. Now that your game object is complete, click on the Create button in the Project view and choose the Prefab option.
Then, rename it to Cue Ball Prefab. Your game object is ready to be re-used in this project. In Unity, game objects can be stored as Prefabs. This is very useful in case you want to re-use a game object in several levels or instantiate it through scripting.
Adobe Flash users can think of it as the Unity equivalent of MovieClips. In this recipe, we haven't used any external asset. However, there's no reason you could not have imported a texture and used it as the Cue Ball Material base map, for instance. Also, if you plan of re-using your Prefab in other projects, you can do it by exporting it as a custom package. As you have probably noticed, spheres are not the only entities you can create directly with Unity. Other primitives are also available, as well as many other types of entities: lights, camera, GUI textures, and so on.
Navigate to GameObject Create Other and experiment with the options available. As you enter Unity for the first time, you might think you'll need to build and code everything from scratch. However, Unity comes with several collections of content called Packages , designed to save you time when implementing commonly required features.
You will see a list of available packages from Unity. These are filled with ready-to-use content. Unity makes implementing commonly requested features easy by making them available as packages ready to be imported and used in your project. Unity also comes with a sample project ready to be dissected by you. It automatically opens the first time you start the software.
After you have created a 3D model, audio clip, movie clip, or texture, you can import it into your project. In this recipe, we will learn how it can be done. Your file should be now listed in the Project browser, as shown here:.
Unity makes a copy of your file, converts it to an appropriate format if necessary and saves it into the Project browser's Assets folder. Here's a couple of helpful pieces of information on the subject:. Unity updates its Project view whenever a new file is added to the Assets folder. You could then save or export your work directly into that folder. You could also paste or move multiple files into there. However, you should not reorganize or rename your imported files via your OS file management system Window's Explorer or Mac OS Finder , as this could damage important information kept by Unity about those files.
Some other useful pages regarding the subject are:. The packages provided by Unity can save you a lot of development time. They usually contain resources such as texture maps, materials, and so on and fully implemented features ready to go into your project. When creating a new project, Unity offers to install those packages into the Assets folder. However, if you've missed it at first, you can still import them into your project at any time. Enter the Import Package sub-menu and choose a package from the list.
Make sure every needed component is selected and click Import. Package contents should be ready and listed in the Project view. Unity installation files include a number of packages that can be imported into your project as ready-to-use resources. Inside those packages are all the assets needed to implement a specific feature or functionality. Once imported, new features can be accessed through the Project view and dragged and dropped into your level or through newly added menu items the Tree Creator package, for instance, adds the Tree option into the Create Other sub-menu of the GameObject menu.
Importing Unity packages can also be done through the Project Wizard. When starting a new project, check the boxes of the packages you want to import. Custom Unity packages are available from a variety of sources, and they can be very helpful when developing a project. As its title implies, this recipe requires a custom package to be imported. Enter the Import Package sub-menu and choose the Custom Package Browse to the package file you have saved on your disk and click Open.
Preview package contents in the top-right Preview window, if you like. Custom packages are commonly used to distribute a number of assets inside a single compressed file. As they are made by third parties, the content inside those packages may vary, as they can include scripts, 3D models, texture maps, materials and any other file handled by Unity. Once imported, the package content is uncompressed into your project's Assets folder, and can be accessed through the Project window.
Third-party made content can also be found, downloaded, and bought from the Unity Asset Store. Creating packages can be a very useful and practical way of storing your game objects and assets for future use and reference. If you want to save a feature, a group of assets, or even a prefab from the project you are currently working on, it's a good idea to export them as a package, so you can easily import them into your future projects. In order to export a package, you will need a project containing some assets.
Select the RotatingCube prefab in the Project view. Go to the Assets menu and choose the Select Decencies option. This will highlight, inside the Project tab, all assets that are linked to the RotatingCube prefab.
Go to the Assets menu and choose Export Package A new window will now pop up:. Inside the Exporting Package window, make sure the Include dependencies checkbox is selected. It is important that checkboxes for all listed objects are also selected.
Click Export and save your package into your disk. You can give it any name you want although a name similar to RotatingCube will make things easier later, when you want to use it. By exporting a package, you have stored your selected objects and dependencies into a single compressed file. Importing them to your project will uncompress them into its Assets folder. If you have one or more packages you'd like to include frequently in your projects, it might be a good idea to add them to Unity's package quick list.
In order to complete this recipe, you will need a custom package any package will do. Go to Unity's Editor folder. Restart Unity. It should now be listed on the Assets menu, under the Import Package sub-menu, as shown in the following screenshot:.
Unity's menu actually reads the Standard Packages folder content when starting up, instead of getting that information from somewhere else. This is very practical, as it always reflects the actual content of that folder and also allows the user to quickly retrieve his favorite packages.
Custom packages stored in the Standard Packages folder will also appear in the Create New Project Wizard window, making it simple to add them to new projects.
It doesn't matter how organized you keep your project folders, there will be times when you will need to search for one or more specific assets. To make things easier, Unity 4 includes the Project browser. In this recipe, we will learn how to save time by using it. All we need to follow this recipe is a collection of assets. Finally, in the new bonus chapter, you'll program some simple AI Artificial Intelligence for a tic tac toe game.
Find out what all the fuss is about by getting up to speed using this book! What you will learn from this book Explore the basic development flow of the Unity 3D game engine Understand fundamental programming concepts in both Javascript and C Develop five different games from inception to completion Discover the secrets new game developers use to be successful when they're just starting out Grasp the nuances of Unity's immediate-mode GUI Completely re-skin a game for fun and potentially profit Lengthen gameplay by learning how to use random numbers Explore the process of writing Artificial Intelligence from scratch Approach This is a practical and light-hearted guide to get to grips with creating your first games, with easy-to-follow, step-by-step tutorials using the award winning Unity engine.
Create action-packed 3D games with the Microsoft XNA Framework Overview Learn the structure of a 3D world and how to implement a variety of 3D techniques including terrain generation and 3D model rendering. Build three different types of 3D games step-by-step, including a first-person maze game, a battlefield tank game, and a 3D sidescrolling action game on the surface of Mars.
Create a 3D maze, fire shells at enemy tanks, and drive a rover on the surface of Mars while being attacked by alien sa Learn how to create exciting games using Unity 3D for Android with the help of hands-on examples Overview Enter the increasingly popular mobile market and create games using Unity 3D and Android Learn optimization techniques for efficient mobile games Clear, step-by-step instructions for creating a complete mobile game experience In Detail Powerful and continuing to grow, the mobile market has never been bigger and more demanding of great games.
Android continues to prove itself as a strong contender in this challenging market. With Unity 3D, great games can be made for Android quickly and easily. With its great deployment system, the Android platform is now only one click away.
0コメント