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) {}


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章