参考原文: UE4-常见的宏-UFUNCTION
该函数可以在蓝图或关卡蓝图图表中执行
cpppublic:
UFUNCTION(BlueprintCallable, Category = "Snowing,BlueprintFunc")
void BlueprintCallableFunction();
此函数可以在蓝图或关卡蓝图图表内进行重载 不能修饰private级别的函数,函数在C++代码中不需要实现定义
cpppublic:
UFUNCTION(BlueprintImplementableEvent, meta = (DisplayName = "Blueprint Implementable Event Function"), Category = "Snowing|BlueprintFunc")
float BlueprintImplementableEventFunction(float In_Float);
Category = TopCategory|SubCategory|Etc
指定函数在编辑器中的显示分类层级,|
是分层级的符号
cppUFUNCTION(BlueprintPure, Category = "Snowing|BlueprintFunc")
AActor* BlueprintPureFunction();
用法:UFUNCTION( [函数说明符], meta = (元数据说明符) )
指示BlueprintCallable函数应该使用“Commutative Associative Binary”节点。该节点缺少引脚名称,但具有创建附加输入引脚的“Add Pin”按钮
cpp//.h文件函数声明
UFUNCTION(BlueprintPure, meta = (DisplayName = "Add Pin Function", CommutativeAssociativeBinaryOperator = "true"), Category = "Snowing|Parameters")
float CommutativeAssociativeBinaryOperatorFunction(const float A, const float B);
//.cpp文件行数定义
float AActorTest::CommutativeAssociativeBinaryOperatorFunction(const float A, const float B)
{
float Result{0.f};
Result += A;
Result += B;
return Result;
}
指示BlueprintCallable函数应在紧凑显示模式下显示,并提供在该模式下显示的名称
cppUFUNCTION(BlueprintCallable, meta = (AutoCreateRefTerm = "In_Int32", CompactNodeTitle = "CompactNodeTitleFunction"), Category = "Snowing|Parameters")
int32 AutoCreateRefTermFunction(UPARAM(Ref) int32& In_Int32);
蓝图中此节点的名称将替换为此处提供的值,而不是代码生成的名称(在蓝图中搜索被修饰函数也用这里提供的值)
对于BlueprintCallable函数,这表示参数引脚应该隐藏在用户的视图中。请注意,每个功能只能有一个参数引脚以这种方式隐藏
cppUFUNCTION(BlueprintCallable, meta = (HidePin = "In_Float"), Category = "Snowing|Parameters")
void HidePinFunction(int In_Int, float In_Float, FString In_FString, TArray<AActor*> In_TArray);
本文作者:OhtoAi
本文链接:
版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!