About This E-Book
EPUB is an open, industry-standard format for e-books. However, support for EPUB and its many features varies across reading devices and applications. Use your device or app settings to customize the presentation to your liking. Settings that you can customize often include font, font size, single or double column, landscape or portrait mode, and figures that you can click or tap to enlarge. For additional information about the settings and features on your reading device or app, visit the device manufacturers Web site.
Many titles include programming code or configuration examples. To optimize the presentation of these elements, view the e-book in single-column, landscape mode and adjust the font size to the smallest setting. In addition to presenting code and configurations in the reflowable text format, we have included images of the code that mimic the presentation found in the print book; therefore, where the reflowable format may compromise the presentation of the code listing, you will see a Click here to view code image link. Click the link to view the print-fidelity code image. To return to the previous page viewed, click the Back button on your device or app.
Mike Geig
SamsTeachYourself
Unity 2018
Game Development
800 East 96th Street, Indianapolis, Indiana 46240 USA
Sams Teach Yourself Unity 2018 Game Development in 24 Hours
Copyright 2018 by Pearson Education
All rights reserved. Printed in the United States of America. This publication is protected by copyright, and permission must be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permissions, request forms, and the appropriate contacts within the Pearson Education Global Rights & Permissions Department, please visit www.pearsoned.com/permissions/. No patent liability is assumed with respect to the use of the information contained herein. Although every precaution has been taken in the preparation of this book, the publisher and author assume no responsibility for errors or omissions. Nor is any liability assumed for damages resulting from the use of the information contained herein.
ISBN-13: 978-0-13-499813-8
ISBN-10: 0-13-499813-8
Library of Congress Control Number: 2018902432
01 18
Trademarks
All terms mentioned in this book that are known to be trademarks or service marks have been appropriately capitalized. Sams Publishing cannot attest to the accuracy of this information. Use of a term in this book should not be regarded as affecting the validity of any trademark or service mark.
Warning and Disclaimer
Every effort has been made to make this book as complete and as accurate as possible, but no warranty or fitness is implied. The information provided is on an as is basis. The author and the publisher shall have neither liability nor responsibility to any person or entity with respect to any loss or damages arising from the information contained in this book.
The Unity name, logo, brand, and other trademarks or images featured or referred to within this book are licensed from and are the property of Unity Technologies. Neither this book or the publisher is affiliated with, endorsed by, or sponsored by Unity Technologies.
All images herein of the Unity editor are provided courtesy of Unity Technologies. 201718 Unity Technologies
Microsoft and/or its respective suppliers make no representations about the suitability of the information contained in the documents and related graphics published as part of the services for any purpose all such documents and related graphics are provided as is without warranty of any kind. Microsoft and/or its respective suppliers hereby disclaim all warranties and conditions with regard to this information, including all warranties and conditions of merchantability, whether express, implied or statutory, fitness for a particular purpose, title and non-infringement. In no event shall Microsoft and/or its respective suppliers be liable for any special, indirect or consequential damages or any damages whatsoever resulting from loss of use, data or profits, whether in an action of contract, negligence or other tortious action, arising out of or in connection with the use or performance of information available from the services.
The documents and related graphics contained herein could include technical inaccuracies or typographical errors. Changes are periodically added to the information herein. Microsoft and/or its respective suppliers may make improvements and/or changes in the product(s) and/or the program(s) described herein at any time. Partial screen shots may be viewed in full within the software version specified.
Microsoft Windows, and Microsoft Office are registered trademarks of the Microsoft Corporation in the U.S.A. and other countries. This book is not sponsored or endorsed by or affiliated with the Microsoft Corporation.
Special Sales
For information about buying this title in bulk quantities, or for special sales opportunities (which may include electronic versions; custom cover designs; and content particular to your business, training goals, marketing focus, or branding interests), please contact our corporate sales department at or (800) 382-3419.
For government sales inquiries, please contact .
For questions about sales outside the U.S., please contact .
Editor-in-Chief
Mark Taub
Acquisition Editors
Laura Lewin
Malobika Chakraborty
Development Editor
Michael Thurston
Managing Editor
Sandra Schroeder
Project Editor
Mandie Frank
Copy Editor
Kitty Wilson
Indexer
Erika Millen
Proofreader
Gill Editorial Services
Technical Editor
Michael Wu
Editorial Assistant
Courtney Martin
Designer
Chuti Prasertsith
Compositor
codemantra
Contents at a Glance
Table of Contents
Preface
The Unity game engine is an incredibly powerful and popular choice for professional and amateur game developers alike. This book has been written to get readers up to speed and working in Unity as fast as possible (in about 24 hours, to be exact) while covering fundamental principles of game development. Unlike other books that cover only specific topics or spend the entire time teaching a single game, this book covers a large array of topics while still managing to contain four games. Talk about a bargain! By the time you are done reading this book, you wont have just theoretical knowledge of the Unity game engine. You will have a portfolio of games to go with it.
About the Author
Mike Geig is the global head of evangelism content at Unity Technologies, where he helps democratize game development by developing and delivering high-impact learning resources. Mike has experience as an indie game developer, a university educator, and an author. A gamer at heart, Mike works to make the development of interactive entertainment fun and accessible for all skill sets. Hi, Mom!
Dedication
Kara, I decided to wait until the third edition to dedicate this book to you so that later, when you say, You never dedicated a book to me, I can respond with, Guess again! Thank you for continuing to be my foundation.
Acknowledgments