sample1.cpp
UCLASS()
class AT_API ClassName
{
public:
UFUNCTION(BlueprintCallable)
void Function(int a, int b);
UFUNCTION(BlueprintCallable)
void Function(int a, int b, int c);
}
エラー
error : 'Function' conflicts with 'Function /Script/Project Name.ClassName:Function'
エンジンソースを見てみると下記のようになっています。
/UE4/UnrealEngine/Engine/Source/Programs/UnrealHeaderTool/Private/HeaderParser.cpp
1858: FError::Throwf(TEXT("'%s' conflicts with '%s'"), *ThisName.ToString(), *It->GetFullName() );
HeaderParserは非関数リストに新しい関数を追加する前に、既知の関数名をすべて列挙(iterate)する。
パラメータが何であっても、同じ名前のものがあればこのエラーがスローされます。
したがって、同じクラスに同じ名前の2つのUFUNCTIONSを持つことはできません。
UFUNCTION()はオーバーロード出来ないため、回避する必要があります。
他のスクリプト言語でもオーバーロード関数をバインドできなかったりするのでBPの仕様がそうなっているのでしょう。
sample2.cpp
UCLASS()
class AT_API ClassName
{
public:
UFUNCTION(BlueprintCallable)
void Function(int a, int b);
UFUNCTION(BlueprintCallable)
void FunctionWithC(int a, int b, int c); // 関数名を変える
}