Unity 2018 By Example - Second Edition
Copyright 2018 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the authors, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
Commissioning Editor: Kunal Chaudhari
Acquisition Editor: Larissa Pinto
Content Development Editor: Onkar Wani
Technical Editor: Ralph Rosario
Copy Editor: Safis Editing
Project Coordinator: Devanshi Doshi
Proofreader: Safis Editing
Indexer: Rekha Nair
Graphics: Jason Monteiro
Production Coordinator: Aparna Bhagat
First published: July 2016
Second edition: July 2018
Production reference: 1300718
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78839-870-1
www.packtpub.com
mapt.io
Mapt is an online digital library that gives you full access to over 5,000 books and videos, as well as industry leading tools to help you plan your personal development and advance your career. For more information, please visit our website.
Why subscribe?
- Spend less time learning and more time coding with practical eBooks and Videos from over 4,000 industry professionals
- Learn better with Skill Plans built especially for you
- Get a free eBook or video every month
- Mapt is fully searchable
- Copy and paste, print, and bookmark content
PacktPub.com
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at > for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters, and receive exclusive discounts and offers on Packt books and eBooks.
Contributors
About the author
Alan Thorn is an educator, author, and multidisciplinary games-developer with 18 years of tech-industry experience. He is currently Head of Department for the Games Design and Development MA degree at the BAFTA-winning National Film and Television School, London. He has written 27 technical books on game development and presented 29 online training courses. He founded the game-studio Wax Lyrical Games and created the award-winning game Baron Wittard: Nemesis of Ragnarok.
About the reviewer
Adam Larson started programming professionally in 2005. He has shipped 14 console games, 2 PC titles, and 8 mobile games. In 2012, he founded a company that focused on using Unity for business applications. He spent the following 5 years building a million dollar agency that built high-end software. Recently, he moved to another start-up that focuses on revolutionizing the banking industry. When he isn't doing something with technology, you will find him spending time with his wife and three kids.
Packt is Searching for Authors Like You
If you're interested in becoming an author for Packt, please visit authors.packtpub.com and apply today. We have worked with thousands of developers and tech professionals, just like you, to help them share their insight with the global tech community. You can make a general application, apply for a specific hot topic that we are recruiting an author for, or submit your own idea.
Preface
Video games are a cultural phenomenon that has captivated, entertained, and moved billions of people worldwide over the past 50 years. As an industry and movement, video games are an exciting place to be, both for the developer and the artist. In these roles, your vision, ideas, and work can influence wide audiences, shaping and changing generation after generation in an unprecedented way. In more recent times, there's been a general movement toward democratizing game development, making the development process simpler, smoother, and more accessible to a wider audience, including developers perhaps working from home on a very limited budget. Instrumental in this movement is the Unity engine, which forms the main subject of this book. The Unity engine is a computer program that works with your existing asset pipeline (such as 3D modeling software) and is intended for compiling video games that work seamlessly across multiple platforms and devices, including Windows, Mac, Linux, Android, iOS, and Windows Phone. Using Unity, developers import ready-made assets (such as music, textures, and 3D models), and assemble them into a coherent whole, forming a game world that works by a unified logic. Unity is an amazing program. The latest version is free for most people to download and use, and it works well with many other programs, including free software such as GIMP and Blender. This book focuses on the Unity engine and how it can be used in a practical context for making playable and fun games. No prior knowledge of Unity is expected, although some knowledge of programming and scripting (such as JavaScript, ActionScript, C, C++, Java, or C#) would be beneficial. Let's now take a look at what this book covers, on a chapter-by-chapter basis.
Who this book is for
You don't need to have any previous experience with Unity to enjoy Unity 2018 by Example, although you need to have basic knowledge of C#.
What this book covers
This book explores how to use the Unity engine in a hands-on, practical way by looking at concrete examples that result in real-world playable games. Specifically, it focuses on the implementation of 5 distinct projects divided across 10 chapters, 2 chapters per project. Let's take a look at what these projects are:
, Unity Fundamentals , begins our journey into Unity by creating a first-person collection game. This is a great starting point if you're totally new to Unity and are ready to create your first game.
, Creating a Collection Game , continues from the previous chapter and completes the first project. It assumes that you have completed the first chapter and brings a closure to our project, leading neatly to the next chapter.
, Creating A Space Shooter , marks the beginning of our second project, focusing on the creation of a space shooter game. Here, we'll create a project in which the player must shoot the oncoming enemies.
, Continuing the Space Shooter