//暴露我们的函数在蓝图中可调用
UFUNCTION(BlueprintCallable,Category ="MyFunction")
void PrintF1();
//纯函数定义BlueprintPure
UFUNCTION(BlueprintCallab1e,BlueprintPure,Category ="MyFunction")
bool PrintF2();
//BlueprintImplementableEvent在c++中声明,不能定义蓝图可重写(override)
//无返回值相当于事件
UFUNCTION(BlueprintImplementableEvent)
void Test1();
UFUNCTION(BlueprintImplementableEvent)
void Test11(const FString &MyString);
//有返回值相当于函数
UFUNCTION(BlueprintImplementableEvent)
int Test2();
UFUNCTION(BlueprintImplementableEvent)
int Test22(const FString& MyString);
BlueprintNativeEvent在C++中声明和实现蓝图可重载或者不重载
//无返回值相当于事件
UFUNCTION(BlueprintNativeEvent)
void TestA();
//注意:在cpp实现中要加入后缀_Implementation,不然过不了编译
void AMyPawn::TestA_Implementation()
{
//重载的话会调用的蓝图的实现
}
//.h定义
//有返回值相当于函数
UFUNCTION(BlueprintNativeEvent)
int TestB();
//.cpp实现
int AMyPawn::TestB_Implementation()
{
return 0;
}
//.h定义
//无返回值相当于事件
UFUNCTION(BlueprintNativeEvent)
void TestC(const FString& mystring);
//.cpp实现
void AMyPawn::TestC_Implementation(const FString& mystring)
{
}
//.h定义
//有返回值相当于函数
UFUNCTION(BlueprintNativeEvent)
int TestD(const FString& mystring);
//.cpp实现
int AMyPawn::TestD_Implementation(const FString& mystring)
{
return 0;
}
元数据说明符meta
UFUNCTION(BlueprintCallable,Category ="MyFunction",meta=(DisplayName =“MyPrinttest"))
void Printtest();