ue4 中函数参数的写法

方便自己记忆:

带输入的参数:

1,直接传值

UFUNCTION(BlueprintCallable)
void Function_Input(float value) {}

2,const &

UFUNCTION(BlueprintCallable)

void Function_ConstInput(const float& value)  {}

输出参数俩种方式:

UFUNCTION(BlueprintCallable)

void function_Out(float& value) {}

UFUNCTION(BlueprintCallable)

float  function_Return() { return 66; }

纯函数:

//纯函数写法
UFUNCTION(BlueprintCallable, BlueprintPure)
void function_Pure( const float& inputvalue,float& value) {}


UFUNCTION(BlueprintCallable, BlueprintPure)
float  function_PureReturn() { return 33; }

ref参数写法

UFUNCTION(BlueprintCallable)
void function_Input_Ref(UPARAM(ref)  float& value) {}


猜你喜欢

转载自blog.csdn.net/weixin_36369675/article/details/80471224
今日推荐