.h
UFUNCTION(BlueprintCallable,BlueprintPure)
static bool ReturnIsEdiror();
.cpp
bool USBlueprintFunctionLibrary::ReturnIsEdiror()
{
#if WITH_EDITOR
// 在编辑器模式下执行的逻辑
return true;
#else
// 在游戏模式下执行的逻辑
return false;
#endif
return false;
}