The basics of basics - Variables
We have the following objective:
The objective is to create various variables for different types of data which we’d like to store in the program.
As variables are usually declared with a private access modifier, we will add a [SerializeField] attribute for the data type, in order to make the variable visible in the Unity Editor.
A name is usually a string of letters. Therefore, we need the data type string:
Age, health, score and current Ammo are usually full numbers. That being the case, we will need the Integer (or int for short) as the data type:
The speed variable can be either as full number or not. Therefore, it would be best to use the float data type. Even if we are using a full number.
haveKeysBeenCollected is a question. For this, we will use the bool data type. The question can either be true or false.