UFUNCTION(BlueprintCallable, BlueprintImplementableEvent, Category=Trigger Reaction)
bool ReactToTrigger();BlueprintCallable
引用实现接口的对象的C++或蓝图可以调用使用 BlueprintCallable 说明符的函数。
BlueprintImplementableEvent
使用 BlueprintImplementableEvent 的函数不能在C++中被腹杆,但可以任何实现或继承接口的蓝图类中被覆盖。
BlueprintNativeEvent
在C++中,可通过覆盖一个同名函数来实现使用 BlueprintNativeEvent 的函数,但要在末尾添加上后缀 _Implementation。
如果您想要蓝图能够实现此接口,则必须使用"Blueprintable"元数据说明符。蓝图类要覆盖的每个接口函数都必须是"BlueprintNativeEvent"或"BlueprintImplementableEvent"。标记为"BlueprintCallable"的函数仍然可以被调用,但不能被覆盖。您将无法从蓝图访问所有其他函数。
创建interface
在interface里创建纯虚函数或者虚函数
在要使用的类中添加interface的头文件
声明一下接口函数
定义使用