Unity Certified Programmer: Exam Guide

Book description

A practical guide to Unity game scripting using C#, backed with practice tests, exam tips, and easy-to-follow examples to help you better prepare for the exam and become a pro in Unity programming

Key Features

  • Discover the essentials of game scripting with Unity and C# to customize every aspect of your game
  • Overcome challenges in Unity game development using effective techniques and easy solutions
  • Pass the Unity certification exam with the help of mock tests, exam tips, and self-assessment questions

Book Description

Unity Certified Programmer is a global certification program by Unity for anyone looking to become a professional Unity developer. The official Unity programmer exam will not only validate your Unity knowledge and skills, but also enable you to be part of the Unity community.

This study guide will start by building on your understanding of C# programming and take you through the process of downloading and installing Unity. You'll understand how Unity works and get to grips with the core objectives of the Unity exam. As you advance, you'll enhance your skills by creating an enjoyable side-scrolling shooter game that can be played within the Unity Editor or any recent Android mobile device. This Unity book will test your knowledge with self-assessment questions and help you take your skills to an advanced level by working with Unity tools such as the Animator, Particle Effects, Lighting, UI/UX, Scriptable Objects, and debugging.

By the end of this book, you'll have developed a solid understanding of the different tools in Unity and understand how to create impressive Unity applications by making the most of its toolset.

What you will learn

  • Discover techniques for writing modular, readable, and reusable scripts in Unity
  • Implement and configure objects, physics, controls, and movements for your game projects
  • Understand 2D and 3D animation and write scripts that interact with Unity's Rendering API
  • Explore Unity APIs for adding lighting, materials, and texture to your apps
  • Write Unity scripts for building interfaces for menu systems, UI navigation, application settings, and much more
  • Delve into SOLID principles for writing clean and maintainable Unity applications

Who this book is for

The book is for game developers, software developers, mobile app developers, and Unity developers who want to advance in the game or related industry. Basic knowledge of C# programming and Unity engine is required.

Table of contents

  1. Title Page
  2. Copyright and Credits
    1. Unity Certified Programmer: Exam Guide
  3. About Packt
    1. Why subscribe?
  4. Contributors
    1. About the author
    2. About the reviewer
    3. Packt is searching for authors like you
  5. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
      1. Download the example code files
      2. Code in Action
      3. Conventions used
    4. Get in touch
      1. Reviews
  6. Setting Up and Structuring Our Project
    1. The core exam skills covered in this chapter
    2. Technical requirements
    3. The six core objectives
      1. Programming core interactions
      2. Working in the art pipeline
      3. Developing application systems
      4. Programming for the scene and environment design
      5. Optimizing performance and platforms
      6. Working in professional software development teams
    4. Overview of design patterns
      1. Builder
      2. Singleton
      3. Abstract Factory
      4. Prototype
      5. Object Pool
      6. Dependency Injection
    5. The SOLID principles
      1. Single responsibility principle
      2. Open/closed principle
      3. Liskov substitution principle
      4. Interface segregation principle
      5. Dependency inversion principle
    6. Designing the Killer Wave game
      1. Game design brief
    7. The Killer Wave game framework
      1. Framework
    8. Setting up Unity
      1. Starting our project through Unity Hub
    9. Collaborate
      1. Setting up Collaborate
      2. Ignoring files and folders
      3. Reverting changes
      4. The dashboard
    10. Summary
  7. Adding and Manipulating Objects
    1. Core exam skills covered in this chapter
    2. Technical requirements
    3. Setting up our Unity project
      1. Creating prefabs
        1. Enemy prefab and custom tags
        2. Creating the player's bullet prefab
          1. Creating and applying a material to the player's bullet
          2. Adding a light to the player's bullet
      2. Adding Rigidbody components and fixing game objects
      3. Saving and publishing our work
      4. Setting up our camera
        1. Updating our camera properties via a script
      5. Setting up our light
        1. Updating our light properties via a script
    4. Introducing our interface – IActorTemplate
    5. Introducing our ScriptableObject – SOActorModel
      1. Creating a PlayerSpawner ScriptableObject asset
      2. Creating an EnemySpawner ScriptableObject asset
      3. Creating a PlayerBullet ScriptableObject Asset
    6. Setting up our Player, PlayerSpawner, and PlayerBullet scripts
      1. Setting up our PlayerSpawner script
        1. Creating the PlayerSpawner game object
      2. Setting up our Input Manager
      3. Setting up our Player script
        1. Colliding with an enemy – OnTriggerEnter
        2. The Movement method
        3. The Die method
        4. The Attack method
      4. Setting up our PlayerBullet script
    7. Planning and creating our enemy
    8. Setting up our EnemySpawner and Enemy scripts
      1. Adding our script to the EnemySpawner game object
      2. Setting up our enemy script
    9. Summary
  8. Managing Scripts and Taking a Mock Test
    1. The core exam skills covered in this chapter
    2. Technical requirements
    3. Adding a Singleton design pattern
    4. Setting up our ScenesManager script
      1. Adding the ResetScene() method
      2. Adding the GameOver() method
      3. Adding the BeginGame() method
      4. Adding scenes to our Build Settings window
        1. Updating our GameManager script
    5. Creating lives for the player
    6. Scoring enemy hits
      1. Preparing the code for the ScoreManager script
      2. Setting up our ScoreManager script
    7. Creating sounds for the player's bullets
    8. Summary
    9. Mock test
  9. Applying Art, Animation, and Particles
    1. The core exam skills covered in this chapter
    2. Technical requirements
    3. Adding visuals to the player's ship prefab
      1. Creating a material for our player's ship prefab
      2. Applying maps to our PlayerShip material
      3. Adding neon lights to our PlayerShip prefab
      4. Adding particles to our PlayerShip prefab
    4. Creating a particle effect
      1. Setting up the Emission section of our particle system
      2. Setting up the Shape section of our particle system
      3. Setting up the Force over Lifetime section of our particle system
      4. Setting up the Renderer section of our particle system
      5. Setting up the Texture Sheet Animation section of our particle system
    5. Importing and animating the background
      1. Adding an animator controller
      2. Creating states in the animator controller
      3. Animation
    6. Animating our three-dimensional enemies
    7. Summary
  10. Creating a Shop Scene for Our Game
    1. The core exam skills covered in this chapter
    2. Technical requirements
    3. Introducing our shop scripts
      1. Importing and calibrating our sprite game object
      2. Displaying credit on our itemText game object
      3. Project files diagnosis when making SelectionQuad
    4. Customizing our shop selection
      1. Creating selection templates
      2. Customizing our player ship's upgrade selection
    5. Selecting game objects with raycasts
    6. Adding information to our description panel
    7. Summary
  11. Purchasing In-Game Items and Advertisements
    1. The core exam skills covered in this chapter
    2. Technical requirements
    3. Buying upgrades for our player's ship
      1. Updating visual representations of our player's ship
      2. Preparing our player's ship to be used in the game
    4. Buying items, watching adverts, and preparing to start a game
      1. Setting up the BUY? button
      2. Setting up the START button
      3. Setting up the WATCH AD button
        1. Connecting Unity ads to our game
        2. Attaching Unity reward adverts to our script
    5. Extending the PlayerSpawner script
    6. Summary
  12. Creating a Game Loop and Mock Test
    1. Core exam skills covered in this chapter
    2. Technical requirements
    3. Transitioning our player ship
      1. Adding variables to our PlayerTransition script
      2. Adding methods/functions to our PlayerTransition script
      3. Adding if statement checks
      4. Adding content to the PlayerMovement IEnumerator
      5. Moving the player ship out of the screen
    4. Expanding our ScenesManager script
      1. Adding a game level timer
      2. Beginning, resetting, and skipping levels
    5. Preparing to loop our game
      1. Setting up the BootUp scene
      2. Setting up the title and gameOver scenes
      3. Demonstrating that the game loop is complete
    6. Summary
    7. Mock test
  13. Adding Custom Fonts and UI
    1. Core exam skills being covered in this chapter
    2. Technical requirements
    3. Introducing the Canvas and UI
    4. Applying text and images to our scenes
      1. Improving our title scene
      2. Duplicating our game objects
      3. Preparing to animate UI game objects
      4. Animating our UI level title
        1. Animating the 2D text component
        2. Animating the Image component's center strip
        3. Copying and pasting art, text, and animation into other scenes
    5. Summary
  14. Creating a 2D Shop Interface and In-Game HUD
    1. Core exam skills covered in this chapter
    2. Technical requirements
    3. Setting up our HUD
      1. Displaying the player's lives
        1. Adding a Horizontal Layout Group component to our game object
        2. Creating images to represent our life count
        3. Coding our UI life counter
      2. Displaying the player's score
      3. Creating a mini-map
        1. Creating and adding layers to our player and enemy game objects
        2. Adding and customizing our Render Texture
        3. Adding and customizing our second camera
    4. Making our shop scene support alternative screen ratios
      1. Upgrading our shop selection
        1. Preparing our shop scene to go 2D
        2. Adding layout group components
        3. Adding UI buttons
          1. Adding the outline game object
          2. Adding the backPanel game object
          3. Adding the selection game object
          4. Adding the powerUpImage game object
          5. Adding the itemText game object
    5. Applying and modifying our shop scripts
      1. Reviewing the button's results
        1. Creating the advert and start buttons
        2. Adding the BUY? button
        3. Replacing our textBoxPanel game object
        4. Upgrading the PlayerShipBuild script
          1. Removing the old shop scene's code
          2. Reviewing code – REMOVED 01
          3. Reviewing code – REMOVED 02
          4. Reviewing code – REMOVED 03
          5. Reviewing code – REMOVED 04
          6. Reviewing code – REMOVED 05
        5. Adding methods to our PlayerShipBuild script
        6. Applying trigger events to call methods
    6. Summary
  15. Pausing the Game, Altering Sound, and a Mock Test
    1. Core exam skills covered in this chapter
    2. Technical requirements
    3. Applying and adjusting level music
      1. Updating our GameManager prefab
      2. Preparing states for our game music
      3. Implementing our game's music states
      4. Using StartCoroutine with our music states
    4. Creating a pause screen
      1. Volume UI slider
    5. Adding a game pause button
      1. Creating our PauseComponent script
        1. PauseScreen basic setup and PauseButton functionality
        2. Resuming or quitting the game from the pause screen
        3. Pausing player and enemies
    6. Summary
    7. Mock test
  16. Storing Data and Audio Mixer
    1. Core exam skills covered in this chapter
    2. Technical requirements
    3. Using the Audio Mixer
      1. Attaching Audio Mixer to UI sliders
    4. Storing data
      1. PlayerPrefs and volume settings
      2. JSON and storing game stats
      3. Adding JSON variables
    5. Exploring Unity Analytics and Remote Settings
      1. Analytic events
        1. Core Events
        2. Standard Events
          1. Application
          2. Progression
          3. Onboarding
          4. Engagement
          5. Monetization
        3. Custom Events
        4. Transaction Events
      2. Remote Settings
    6. Summary
  17. NavMesh, Timeline, and a Mock Test
    1. The core exam skills covered in this chapter
    2. Technical requirements
    3. Preparing the final scene
    4. Developing AI with NavMesh
      1. Customizing our agents – NavMeshAgent
        1. Adding a capsule collider to our fleeing enemy
        2. Creating our fleeing enemy script
    5. Exploring the timeline
      1. Creating a timeline
        1. Setting up the boss game object in our scene
        2. Preparing boss for the timeline
        3. Animating the boss in the timeline – phase one
        4. Animating the boss in the timeline – phase two
    6. Extending the timeline
      1. Adding Default Playables to the project
      2. Manipulating light components in the timeline
    7. Summary
    8. Mock test
  18. Effects, Testing, Performance, and Alt Controls
    1. Core exam skills being covered in this chapter
    2. Technical requirements
    3. Applying physics with RigidBody
    4. Customizing for different platforms
      1. Navigating and firing the player's ship with the touch screen
      2. Extending screen ratio support
    5. Preparing to build Killer Wave for mobile
      1. Setting up the lighting for Killer Waves for Android
      2. Stopping involuntary player controls
      3. Final optimizations for Killer Wave
        1. Reducing texture sizes and compression
        2. Adding explosions to our players and enemies
      4. Setting up the build settings for Android
    6. Applying PC visual improvements
      1. Post-processing
        1. Installing post-processing
        2. Preparing and applying post-processing to our title and level scenes
        3. Post-processing effects (overrides)
          1. Bloom
          2. Chromatic Aberration
          3. Color Grading
          4. Anti-aliasing modes
          5. Creating and applying post-processing profiles
    7. Adding global illumination and other settings
      1. Adding art assets to our shop scene
      2. Reflection probe
    8. Building and testing our game
      1. Tackling bugs
        1. Bug report – "Standalone AD button"
        2. Bug report – "Resetting player's lives"
        3. Bug report – "Slower systems on level 3"
        4. Bug report – "Sometimes, the game ends too quickly"
      2. Understanding the Profiler
      3. Frame Debugger
      4. Tackling bugs – answers
        1. Bug report – "Standalone AD button" solution
        2. Bug report – "Resetting player's lives" solution
        3. Bug report – "Slower systems on level 3" solution
        4. Bug report – "Sometimes, the game ends too quickly" solution
    9. Summary
  19. Full Unity Programmer Mock Exam
    1. Full mock exam
  20. Appendix
    1. Developing for Virtual Reality
    2. Unity's current networking setup
    3. Closing suggestions for the game/exam
      1. Installing the post-processing package in Unity 2018.1+
      2. Rendering paths
      3. Adding/optimizing Killer Wave
    4. Mock answers
      1. Chapter 3
      2. Chapter 7
      3. Chapter 10
      4. Chapter 12
      5. Full mock
  21. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think

Product information

  • Title: Unity Certified Programmer: Exam Guide
  • Author(s): Philip Walker
  • Release date: June 2020
  • Publisher(s): Packt Publishing
  • ISBN: 9781838828424