BlueprintType,使当前类可以作为蓝图中的类型使用。新建一个继承UObject的C++类CustomObject:


UObject默认是无法作为蓝图中的类型使用的,打开关卡蓝图,声明一个CustomObject变量:

可以看到,这里无法声明CustomObject类型的变量,我们为CustomObject添加BlueprintType标记宏:


这样我们自定义的类就能作为蓝图类型使用了
NotBlueprintType,使当前类不可作为蓝图类型使用。新建一个C++类CustomActor,继承AActor:

Actor类默认是可以作为蓝图类型使用的,我们在关卡蓝图中声明一个CustomActor变量:

然后给CustomActor添加NotBlueprintType标记宏:


这样就可以禁止C++中的类作为蓝图中的类型使用。
那么好玩的来了,如果一个蓝图类型的变量中含有一个非蓝图类型的变量时,能否在蓝图中使用呢?在添加BlueprintType的CustomObject中声明添加了NotBlueprintType的CustomActor变量:
ClassGroup,用来标记component组件类,给组件分组。

新建一个CustomComponent类,继承UActorComponent,并修改他的ClassGroup为Customponent:


这样我们的组件就会在CustomComponent分类中。
Blueprintable,使当前类能够被蓝图类继承。继承UObject的C++类,默认是不能被蓝图类继承的:

给他加上Blueprintable标记:


这样,蓝图类就能继承它了。
NotBlueprintable,禁止当前类被蓝图类继承。继承AActor的C++类,默认是可以被蓝图类继承的:

给CustomActor添加NotBlueprintable标记:


这样蓝图类就无法继承此类了。
Config,可以对类中的变量进行自动本地化读写,用法见:http://t.csdn.cn/htTJJ