Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Game Development with Unity for .NET Developers

You're reading from   Game Development with Unity for .NET Developers The ultimate guide to creating games with Unity and Microsoft Game Stack

Arrow left icon
Product type Paperback
Published in May 2022
Publisher Packt
ISBN-13 9781801078078
Length 584 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Jiadong Chen Jiadong Chen
Author Profile Icon Jiadong Chen
Jiadong Chen
Arrow right icon
View More author details
Toc

Table of Contents (16) Chapters Close

Preface 1. Part 1: Basic Unity Concepts
2. Chapter 1: Hello Unity FREE CHAPTER 3. Chapter 2: Scripting Concepts in Unity 4. Part 2: Using C# Scripts to Work with Unity's Built-In Modules
5. Chapter 3: Developing UI with the Unity UI System 6. Chapter 4: Creating Animations with the Unity Animation System 7. Chapter 5: Working with the Unity Physics System 8. Chapter 6: Integrating Audio and Video in a Unity Project 9. Part 3: Advanced Scripting in Unity
10. Chapter 7: Understanding the Mathematics of Computer Graphics in Unity 11. Chapter 8: The Scriptable Render Pipeline in Unity 12. Chapter 9: The Data-Oriented Technology Stack in Unity 13. Chapter 10: Serialization System and Assets Management in Unity and Azure 14. Chapter 11: Working with Microsoft Game Dev, Azure Cloud, PlayFab, and Unity 15. Other Books You May Enjoy

Working with different features in Unity

Nowadays, Unity is no longer just a game engine but also a creative tool widely used in various industries. However, Unity still retains its game engine roots, and it remains one of the most popular game engines. To learn how to use Unity to develop games, you must first understand what features Unity provides for game developers as a game engine.

In fact, almost all game engines provide similar functional modules to Unity to game developers. So, the first question is, what exactly is a game engine?

What is a game engine?

The term game engine is widely used in the game industry, but not everyone knows what this term means, especially new game developers. So, I will explain what a game engine is and, at the same time, introduce the corresponding functions in Unity.

A game engine is not just a computer graphics renderer. Of course, rendering is an important function of a game engine, but the process of creating a game is much more complicated than just rendering.

As a game developer, you need to import different types of digital assets, such as 3D models, 2D textures, and audio, and most of these digital assets are not created inside a game engine. Therefore, a game engine should provide the function of managing digital assets. In addition to digital assets, you also need to use scripts to add game logic to guide these assets to perform correct behaviors, such as character interactions.

UI is another integral part of a game, and even some gameplay is based on UI. Therefore, a good game engine should provide an easy-to-use and powerful UI toolkit to develop user interfaces for games.

You can use other software to develop animation files and import them into a game engine, but in order for animation files to be played and controlled correctly in the game, the game engine needs to provide an animation feature.

At the same time, a physical effect is a common function in modern games, so a powerful game engine should provide a physical function so that game developers do not need to implement a physical effect from scratch.

There is no doubt that adding video and audio to your game can make your game livelier and more interesting. With audio especially, suitable background music and some appropriate sound effects can make your game feel completely different. Even if it is just a prototype, background music and sound effects can make the game more complete and more professional. Therefore, although many people often ignore the functions of video and sound when talking about game engines, I don't think that a game engine without video and audio functions is a good one.

As you can see, there are many features in a game engine for game developers to develop their games. A game engine integrates all aspects of creating a game to create a complete game user experience. So, in game development, you will deal with different functions. For example, you may need to properly manage digital assets and create appropriate digital assets for your game engine to optimize performance at runtime, or you may need to know how to use the scripting function provided by the game engine you are using to develop logic for your game.

As one of the most popular game engines, Unity also provides the aforementioned functions. In the following subsection, I will introduce these functions in Unity.

Features in Unity

Like other excellent game engines, Unity also provides many functions for game developers. You will be introduced to these functions in the following sections.

Graphics

The first feature I want to introduce is graphics in Unity. You can use Unity's graphics features to create beautiful, optimized graphics on various platforms:

Figure 1.47 – A Unity HDRP template Scene

A render pipeline performs a series of operations that render the contents of a Scene on a screen. There are three render pipelines available in Unity:

  • The Built-in Render Pipeline, which is the default render pipeline in Unity. You cannot modify this render pipeline.
  • The Universal Render Pipeline (URP), which allows developers to customize and create optimized graphics for different platforms.
  • The High Definition Render Pipeline (HDRP), which focuses on cutting-edge, high-fidelity graphics on high-end platforms.

In addition, you can also create your own render pipeline by using the Scriptable Render Pipeline API in Unity. We will introduce it in detail in Chapter 8, The Scriptable Render Pipeline in Unity.

Scripting

Scripting is another essential feature of Unity. You need scripts to implement the game logic in your games.

The Unity engine is built with native C/C++ internally, but it offers scripting APIs in C#, so you do not have to learn C/C++ to create a game. In the following sections and chapters, you will learn more about the concepts of scripting.

UI

UI is very important for a game, and Unity offers three different UI solutions for game developers:

  • The Immediate Mode Graphical User Interface (IMGUI)
  • The Unity UI (uGUI) package
  • The UI Toolkit

The IMGUI is a relatively old UI solution in Unity, and it is not recommended for building a runtime UI. The UI Toolkit is the latest UI solution; however, it is still missing some features that you can find in the uGUI package and the IMGUI. The uGUI package is a mature UI solution in Unity, which is widely used in the game industry. We will introduce the uGUI package in detail in Chapter 3, Developing UI with the Unity UI System.

Animation

Animation can make your game more vivid. Unity provides a powerful animation feature called Mecanim that allows you to retarget an animation, control the weight of it at runtime, and call events from the animation playback.

We will introduce Unity's animation system in Chapter 4, Creating Animations with the Unity Animation System.

Physics

Physical simulation is an indispensable feature in certain types of games, and some gameplays are even based entirely on physical simulation. There are different physics engine implementations in Unity, and you can select one according to your game needs.

We will introduce Unity's physics engine implementations in Chapter 5, Working with the Unity Physics System.

Video and audio

Good background music, sound effects, and video can make your game stand out. This is a feature that cannot be ignored. Unity provides video and audio features, allowing your game to play videos on different platforms, and supports real-time mixing and full 3D spatial sound effects.

We will discuss video and audio more in Chapter 6, Integrating Audio and Video in a Unity Project.

Assets

You can import your digital asset files into the Unity Editor, such as 3D models and 2D textures. Unity offers an Asset Import Pipeline to process these imported assets. You can also customize the import settings to control how Unity imports and uses the assets at runtime.

We will introduce assets management and serialization in Chapter 10, Serialization System and Assets Management In Unity and Azure.

We've briefly introduced the functions that a game engine needs to provide and the functions provided by Unity. Next, let's introduce .NET/C# and scripting in Unity.

You have been reading a chapter from
Game Development with Unity for .NET Developers
Published in: May 2022
Publisher: Packt
ISBN-13: 9781801078078
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image