Data Types
Discover C# data types and their usage with variables, such as integers, floats, strings, booleans, and arrays.
We'll cover the following...
Introduction
C# is a powerful programming language commonly used in game development, and Unity is a popular game engine that uses C# as its primary scripting language. In this lesson, we’ll explore some of the critical concepts and syntax of C# in Unity and provide examples and illustrations to help you understand the language.
Integers
Integers store whole numbers in C#, and the int
keyword represents them. Integers are commonly used in game development to describe scores, health points, and other numerical values.
Press + to interact
int health = 100;
Given above is an example of integers in C#.
Floating point numbers
Floating point numbers store decimal numbers in C# and the float
keyword represents them. ...