Hi!
I created a few methods decorated with UFUNCTION(BlueprintCallable), that I use for debugging purpose only. I cannot hide them with WITH_EDITOR macros - UBT ignores those. I imagine the reason for it is to prevent breaking blueprints using such functions in Development builds…
So the only way I could have these functions in Editor builds only is to have them always exposed, calling the actual implementation in editor builds only, and not doing anything otherwise (pseudo-code):
UFUNCTION(BlueprintCallable)
DebugFunction()
{
#if WITH_EDITOR
DebugFunction_Impl()
#else
UE_LOG("Only in Editor builds!");
#endif
}
#if WITH_EDITOR
DebugFunction_Impl()
{
// Implementation
}
#endif
Is there anything cleaner I could do, say with metas?