UMyBPFunctionLibrary中的方法爲靜態方法
UMyBPFunctionLibrary.h
UCLASS()
class UMyBPFunctionLibrary : public UBlueprintFunctionLibrary
{
GENERATED_UCLASS_BODY()
public:
UFUNCTION(BlueprintCallable, Category = "MyFunction|MyClass")
static void Method1();
UFUNCTION(BlueprintCallable, Category = "MyFunction|MyClass")
static void Method2();
UFUNCTION(BlueprintCallable, Category = "MyFunction|MyClass")
static void Method3();
};
UMyBPFunctionLibrary.cpp
UMyBPFunctionLibrary::UMyBPFunctionLibrary(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer)
{
}
void UMyBPFunctionLibrary::Method1()
{
}
void UMyBPFunctionLibrary::Method2()
{
}
void UMyBPFunctionLibrary::Method3()
{
}
這樣藍圖中就可以調用c++中方法method1、method2、method3,方便藍圖與c++交互。