Book Image

Game Development with Unity for .NET Developers

By : Jiadong Chen
Book Image

Game Development with Unity for .NET Developers

By: Jiadong Chen

Overview of this book

Understand what makes Unity the world’s most widely used real-time 3D development platform and explore its powerful features for creating 3D and 2D games, as well as the Unity game engine and the Microsoft Game Dev, including the Microsoft Azure Cloud and Microsoft Azure PlayFab services, to create games. You will start by getting acquainted with the Unity editor and the basic concepts of Unity script programming with C#. You'll then learn how to use C# code to work with Unity's built-in modules, such as UI, animation, physics, video, and audio, and understand how to develop a game with Unity and C#. As you progress through the chapters, you'll cover advanced topics such as the math involved in computer graphics and how to create a custom render pipeline in Unity with the new Scriptable Render Pipeline, all while optimizing performance in Unity. Along the way, you'll be introduced to Microsoft Game Dev, Azure services, and Azure PlayFab, and using the Unity3D PlayFab SDK to access the PlayFab API. By the end of this Unity book, you'll have become familiar with the Unity engine and be ready to develop your own games while also addressing the performance issues that you could encounter in the development process.
Table of Contents (16 chapters)
1
Part 1: Basic Unity Concepts
4
Part 2: Using C# Scripts to Work with Unity's Built-In Modules
9
Part 3: Advanced Scripting in Unity

C# scripts and common UI components in Unity

uGUI has been provided as a built-in package in the Unity Editor since Unity 2019; therefore, we can see the content of the uGUI package directly in the Project window, which also includes the C# source code.

Figure 3.1 – The uGUI package

As we mentioned in the previous chapter, the Unity development workflow is primarily built around the structure of components. uGUI is no exception. It is a component-based UI system that uses different components to provide different UI functions. For example, every button, text, or image you see in the UI is actually a GameObject with a set of components.

As shown in Figure 3.1, we can find the C# source code of many commonly used UI elements, such as Text, Slider, and Toggle. However, some UI components are implemented using C++ code inside the engine, such as Canvas, and the code of such components cannot be viewed from within the Unity Editor.

In this section,...