This is the code repository for Hands-On Unity Game Development, Fourth Edition, published by Packt.
Unlock the power of Unity 2023 and build your dream game
The authors of this book are -Nicolas Alejandro Borromeo, Juan Gabriel Gomila Salas
Take your game development skills to the next level. Dive into the world of game creation confidently by elevating your game development skills. This book is your definitive and practical guide to unlocking the full potential of Unity 2023. Every chapter is designed to empower you to customize your own game, not just replicate what's in the book. This new edition includes immersive Augmented Reality (AR) experiences and performance optimization with Data-Oriented Technology Stack (DOTS).
From Scene Creation to seamless Assert Integration, dive into C# programming and Visual Scripting with step-by-step guidance for beginners. Implement dynamic gameplay elements, including movement, spawning, physics, and health systems. Delve deeper into the magic of Game AI through sensor-driven decision-making with Finite State Machines (FSMs). Elevate your visuals with materials, shaders, textures, and particle systems. Optimize performance with Profiler insights and debug your game for a polished final product.
Whether you're a beginner or a seasoned pro, this book will equip you with the skills needed to bring your game ideas to life.
- Build a game that includes gameplay, player and non-player characters, assets, animations, and more
- Learn C# and Visual Scripting to customize player movements, the UI, and game physics
- Implement Game AI to build a fully functional enemy capable of detecting and attacking
- Use Universal Render Pipeline (URP) to create high-quality visuals with Unity
- Create win-lose conditions using design patterns such as Singleton and Event Listeners
- Implement realistic and dynamic physics simulations with the new Physics System
Section 1: Getting Started with Unity
- Embark on Your Unity Journey
- Crafting Scenes and Game Elements
- From Blueprint to Reality: Building with Terrain and ProBuilder
- Seamless Integration: Importing and Integrating Assets
Section 2: Mastering Programming and Gameplay Mechanics
- Unleashing the Power of C# and Visual Scripting
- Dynamic Motion: Implementing Movement and Spawning
- Collisions and Health: Detecting Collisions Accurately
- Victory or Defeat: Win and Lose Conditions
- Starting your AI Journey: Building Intelligent Enemies for Your Game
Section 3: Elevating Visuals, Effects, and Audio
- Material Alchemy: Using URP and Shader Graph for Stunning Visuals
- Captivating Visual Effeects: Harnessing Particle Systems and VFX Graph
- Enlightening Worlds: Illuminating Scenes with the Universal Render Pipeline
- Immersive Realism: Achieving Fullscreen Eff ects with Postprocessing
- Harmonious Soundscapes: Integrating Audio and Music
Section 4: Designing User Interfaces, Animations and Advanced Concepts
- Interface Brilliance: Designing User-Friendly UI
- Next-Gen UI: Creating Dynamic Interfaces with UI Toolkit
- Animated Realities: Craft ing Animations with Animator, Cinemachine, and Timeline
- Performance Wizardry: Optimizing Your Game with Profiler Tools
- From Prototype to Executable: Generating and Debugging Your Game
- AR/VR
- Massive Worlds: Introduction to DOTS
Teaches you how to install and set up Unity on your computer,as well as how to create your fi rst project.
Teaches you the concepts of Scenes and GameObjects the Unity way to describe what your game world is composed of.
It is where we will be creating our first level layout, prototyping it with the Terrain and ProBuilder Unity features.
It is where we will be creating our first level layout, prototyping it with the Terrain and ProBuilder Unity features.
It is the fi rst programming chapter of the book. We will learn how to create our first script using C# in the Unity way, and then we will explore how to do the same with Visual Scripting, the new node-based coding language of Unity.
Teaches you how to program the movement of your objects and how to spawn them. This chapter introduces the new Unity Input System. General programming knowledge is assumed from this point on.
Teaches you how to confi gure the Physics settings of objects to detect when two of them collide and react to the collision, creating a health system, in this case.
Covers how to detect when the game should end,both when the player wins and loses.
Covers creating a basic AI using several Unity features for creating challenging enemies in our game.
Shows how to use one of the latest Unity render systems (Universal Render Pipeline, or URP) and how to create eff ects with the Shader Graph feature.
Teaches you how to create visual eff ects such as water and fi re using the two main Unity tools for doing so, Particle Systems and VFX Graph, and how to make scripts that control them according to what’s happening in the game.
Looks at lighting, which is a concept big enough to have its own chapter. Here, we will deepen our knowledge of the Universal Render Pipeline, specifi cally its lighting capabilities.
Teaches you how to add a layer of eff ects on top of your scene graphics using the postprocessing feature of the Universal Render Pipeline to get that film effect most modern games have today.
Covers a topic that is underestimated by most beginner developers; here we will learn how to properly add sound and music to our game, taking into consideration its impact on performance. This also covers how to script the sound.
Looks at the User Interface (UI). Of all the graphical ways to communicate information to the user, the UI is the most direct one. We will learn how to display information in the form of text, images, and life bars using the Unity UI system, and also how to script the UI.
Looks at UI Toolkit, which is the successor of Canvas, the UI system we learned about in the previous chapter. We will explore it to get ahead and be prepared for Unity’s use of this HTML-based toolkit in the future.
Takes us further than the static scene we have created so far. In this chapter, we will start moving our characters and creating cutscenes with the latest Unity features to do so, and how to script them.
Discusses how making our game perform well is no easy task, but is certainly needed to release it. Here, we will be learning how to profile our game’s performance and tackle the most common performance issues.
Teaches you how to convert your Unity project into an executable format to distribute it to other people and run it without Unity installed.
Teaches you how to create an AR application with Unity’s AR Foundation package, one of the most recent ways to create AR applications with Unity.
Teaches you how to start creating projects with DOTS, the new Unity technology that allows the creation of highly performant games to create complex gameplay involving thousands of objects on scene.
If you feel this book is for you, get your copy today!
With the following software and hardware list you can run all code files present in the book (Chapter number mention here).
Chapter | Software required | Link to the software | Hardware specifications | OS required |
---|---|---|---|---|
All chapters | Unity 2023.2 | https://unity.com/releases/editor/whats-new/2023.2.2 | Should work on any recent computer | Windows, MacOS, Linux (any) |
All chapters | Visual Studio 2022 Community | https://visualstudio.microsoft.com/downloads/ | Should work on any recent computer | Windows, MacOS (any) |
All chapters | XCode 15 | https://developer.apple.com/xcode/ | Should work on any recent computer | MacOS (any) |
You can get more engaged on the discord server for more latest updates and discussions in the community at Discord
If you have already purchased a print or Kindle version of this book, you can get a DRM-free PDF version at no cost. Simply click on the link to claim your free PDF.
Free-Ebook
We also provide a PDF file that has color images of the screenshots/diagrams used in this book at GraphicBundle
Nicolas Alejandro Borromeo is a game developer currently working for Unity Technologies as a Senior Soft ware Development Consultant and Unity Certifi ed Instructor in London. He is helping Unity clients with their projects all over the world. He started using Unity in 2008 and teaching it in 2012 in Universities and Education Institutes.
Juan Gabriel is the CEO of Frogames Formación, a Spanish e-learning platform. He has reached over half a million students worldwide, publishing around 200 courses.