在项目中 Add Class

UE4 使用 VisualStudio 创建 C++ Class
找到创建的Class 移动要项目中的目录。

#include “xxx.generated.h”

若class中含有 UE4 的宏,比如 UENUM, UFUNCTION等,
需要 ** #include “xxx.generated.h” **

Build Debug Game Editor

然后选择 Debug Game Editor 进行编译(其他模式可能 提示 找不到 generated.h)。

相关文章: