Chapter 1: Setting Up and Structuring Our Project
For some time, Unity has been issuing exams that cover a range of different skills for people who are either graduates, self-taught, or are classed as veterans in their field.
If we check the prerequisites on Unity's website (https://unity.com/products/unity-certifications/professional-programmer), they tell us that this exam isn't for absolute beginners and you need at least 2 years of experience working with Unity and computer programming, including C#. This book will take you through the process of becoming as familiar as possible with Unity and its services, to the point where it might feel like a beginners' course; however, I expect you to know the fundamentals of C# programming, such as what an if statement is, what a function does, and what a class represents. If you don't, I would recommend reading Harrison Ferrone's Learning C# by Developing Games with Unity 2020 book first (https://www.packtpub.com/product/learning-c-by-developing-games-with-unity-2020-fifth-edition/9781800207806). Be aware that this exam is based on Unity 2020 LTS. This is the second edition of the Unity Professional Programmer exam. You will gain no real benefit following this book installing Unity 2021 and upwards. If anything, you run the risk of becoming disconnected from the learning process of this book as the Editor and general functionality may differ.
As you can imagine, it is sometimes difficult to gauge what level a programmer is at with their experience. Imagine what it's like for an employer to recruit someone. Often, a programmer is judged by their portfolio, but what happens if you're a graduate without one or you lack a large quantity of work because you've been too busy studying? Perhaps you've been a programmer for years but can't show any recent work due to signing non-disclosure agreements? Some employers might look at your CV and not even look at your portfolio as the qualifications just don't look impressive enough. The tests a potential employer can put a developer through can also be unbalanced, unfair, unrealistic, and not challenging enough; it's likely that the employer has grabbed a programmer's questionnaire template off the internet to test you.
However, having qualifications from Unity itself sends a clear message that you've been tested and covered all the fields that acknowledge you as a certified Unity programmer. Even if you have a decent portfolio showing a level of standardization and focus, having qualifications from Unity can give you the edge over someone else in a job application.
This book serves two main purposes:
- To take you through a fun, simple, side-scrolling shooter project with some downloadable art assets and sounds that will cover the core objectives in Unity's exam
- To get you as ready for the exam as possible with regular testing and reviewing
So, if you feel like you don't need to carry out the project, skip to the very end of this book to try out the final mock testāactually, I recommend you do this now. Flick to the back of the book, take the test, and if you don't do as well as you planned (that is, score over 75%), at least you know you have something to learn, and working through the project might help. Don't take the exam too soon after taking the mock test if you aren't happy with your scoreāyou will be going up against your own muscle memory, rather than the knowledge itself.
Unity has split the necessary areas of this exam into six core objectives. We will cover what these objectives are in this chapter before introducing our side-scrolling shooter project, which will cover the majority of the objectives. We will also cover specialized subjects outside of the project, such as networking, VR, and more, in the Appendix section of this book.
Throughout the following chapters, we will refresh ourselves with the general practices of codingāa bit like the dos and don'ts when coding a project. Then, we will get to grips with the genre of the game and, hopefully, get you thinking about how to set up a game framework. Finally, we will download and set up our empty project in Unity and learn about Unity services.
In this chapter, we will cover the following topics:
- The six core objectives
- Overview of design patterns
- The SOLID principles
- Designing the Killer Wave game
- The Killer Wave game framework
- Setting up Unity 2020 LTS
- Setting up your Unity project
We won't be doing any coding in this chapter as our focus is on what Unity wants from you in the exam. We will discuss an overview of the methodology and structuring code with design patterns. You may feel tempted to skip some parts because you simply aren't interested, but remember the only reason I am mentioning the majority of this stuff is it's highly likely to come up in the exam. So, please don't feel like I'm punishing you on purpose!
The next section will detail the core objectives covered in this chapter.
The core exam skills covered in this chapter
Working in professional software development teams:
- Setting up your Unity project
- Recognize techniques for structuring scripts for modularity, readability, and reusability.
Technical requirements
Check out the following video to see the Code in Action: https://bit.ly/3klZRqf.
The six core objectives
The exam will mainly focus on scripting and the use of Unity's Application Programming Interface (API), Animation Controller, particles, rendering, and more. The whole idea is to get you familiar with what Unity has to offer you as a programmer. Unity has categorized their exam into core sections, which is a nice way of separating the workload for the exam.
The six core objectives are as follows:
- Programming core interactions
- Working in the art pipeline
- Developing application systems
- Programming for scene and environment design
- Optimizing performance and platforms
- Working in professional software development teams
Let's look at these in more detail.
Programming core interactions
When we load up our first blank scene in Unity, we will be controlling objects (or, as Unity likes to call them, game objects), moving, rotating, and/or expanding them. Not only can you adjust or transform these game objects, but you can also give them components to make them behave like a camera, a light, and/or a piece of animation, and so on. Each one of these components will typically have properties and values. So, for example, a camera component will have properties adjusting its field of view, its background color, and a few other camera-related things. Another example of a component is Rigidbodies. A Rigidbody component is typically used when you want a collision to happen between two game objects. Or what would you want the game object to do when it makes contact with another game object? Will it blow up? Will it collect the other game object? Will it knock it out of the way where one has a greater force? Unity wants you to know how to use these components and game objects. They also want you to know how you can control these objects with a control pad or keyboard controls as if they are characters in a computer game. This may already sound daunting, but you don't need to be a math teacher to be successful (but it's great if you are!). What's so brilliant about Unity is that it does a lot of the hard work for you. All you need to know is what you want and how you want to use it.
To pass the exam, you need to know how to do the following:
- Implement and configure game object behavior and physics
- Implement and configure inputs and controls
- Implement and configure camera views and movement
Let's move on to the second Unity exam core objectiveāthe art.
Working in the art pipeline
As you know, this is a programming exam, so why do we have an exam objective that refers to art? Well, as a programmer, it's highly likely that you will be manipulating game objects to do the things mentioned in the exam objectives. You might not just move something aroundāyou may also want to change a game obj...