Hey there,
you can do something like this:
//BlueprintLibrary.h:
UFUNCTION(BlueprintCallable, meta = (DisplayName = "Function Name", Keywords = "Function Keywords"), Category = "Functions")
bool Function(int32 Foo, TArray<FVector2D> Bar = {{-1,-1}});
//BlueprintLibrary.cpp:
bool BlueprintLibrary::Function(int32 Foo, TArray<FVector2D> Bar)
{
switch (Bar.Contains(FVector2D(-1,-1)))
{
case true: return CppLibrary->Function(Foo);
break;
case false: return CppLibrary->Function(Foo, Bar);
break;
}
}
I know it is not exactly overloading… but it is a cheap workaround.
hope this helps.
quick edit: I gave the example of an array, but an array can not have a default value. In any other case like below it would be possible:
//BlueprintLibrary.h:
UFUNCTION(BlueprintCallable, meta = (DisplayName = "Function Name", Keywords = "Function Keywords"), Category = "Functions")
bool Function(int32 Foo, int32 Bar = -1);
//BlueprintLibrary.cpp:
bool BlueprintLibrary::Function(int32 Foo, int32 Bar)
{
switch (Bar == -1)
{
case true: return CppLibrary->Function(Foo);
break;
case false: return CppLibrary->Function(Foo, Bar);
break;
}
}