Summary
We just investigated the C++ MyShooter
project by looking at the basic project structure and reviewing the source code. You should now have an overall idea about what the C++ scripts do and how they collaborate with the engine and the Blueprints.
From the sample game code, you have also learned some useful Unreal C++ scripting skills.
First, we reviewed the code for creating Unreal recognizable C++ classes by marking them with the UCLASS
macro and the specifiers. You now understand that the Unreal Engine Reflection System will use the information associated with the macros and the specifiers to spawn objects and components. You then got to know some Unreal base classes such as ACharacter
, AActor
, USphereComponent
, UActorComponent
, and AGameModeBase
that can be inherited to create new game classes.
Second, we looked at the code that defines class variables and declares class functions with the UPROPERTY
and UFUNCTION
macros. Like the UCLASS
macro you learned about before...