Getting familiar with the source code
In this section, we will go through the generated .cpp and .h source code and explain the code lines or line blocks so that you can better understand how code is organized and written to implement the expected functionalities.
First of all, let’s take a look at the MyShooterCharacter.h header file for the definition of a typical Unreal class.
MyShooterCharacter.h
MyShooterCharacter.h is the header file that defines the game’s character class. The MyShooterCharacter class is going to be used to create player characters.
The code of this header file can be divided into four parts:
- The definition of the
AMyShooterCharacterclass - The definition of the class variables
- The declaration of the class member functions
- The declaration of the functions for setting up inputs and the getter functions
The header file’s first part mainly defines the MyShooterCharacter class, which inherits from Unreal...