UINTERFACE(MinimalAPI, Blueprintable)
class U接口名称 : public UInterface
{
GENERATED_BODY()
};
/**
*
*/
class 模块名_API I接口名称
{
GENERATED_BODY()
public:
// 只能在C++中重写
virtual 返回类型 接口函数名(参数);
// 只能在蓝图中重写
UFUNCTION(BlueprintCallable, BlueprintImplementableEvent)
返回类型 接口函数名(参数);
// C++ 蓝图都可以重写 WARN : C++调用时 Execute_接口名(目标, 参数)
UFUNCTION(BlueprintCallable, BlueprintNativeEvent)
返回类型 接口函数名(参数);
// C++ 蓝图都可以重写 这个是增加了默认实现接口 WARN : C++调用时 Execute_接口名(目标, 参数)
UFUNCTION(BlueprintCallable, BlueprintNativeEvent)
返回类型 接口函数名(参数);
virtual 返回类型 接口函数名_Implementation(参数); // 在接口中实现一个默认的 接口函数
};
2024年8月10日 – 补
UINTERFACE(BlueprintType, MinimalAPI, meta=(CannotImplementInterfaceInBlueprint))
若不想在蓝图重载 ( BlueprintNativeEvent
, BlueprintImplementableEvent
) 使用
meta=(CannotImplementInterfaceInBlueprint)
标记即可
–Enjoy it–
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
暂无评论内容