Hi, requesting that GetObjectName should be a virtual function.
I have custom UObject child classes, which needs to return GetName differently. In C#,there is virtual ToString for child classes to override.
Even in UKismetSystemLibrary::GetDisplayName, it is doing this. A virtual GetName or ToString wouldn’t need these "hacks’
FString UKismetSystemLibrary::GetDisplayName(const UObject* Object)
{
if (const AActor* Actor = Cast<const AActor>(Object))
{
return Actor->GetActorNameOrLabel();
}
else if (const UActorComponent* Component = Cast<const UActorComponent>(Object))
{
return Component->GetReadableName();
}
return Object ? Object->GetName() : FString();
}