Much better handling of type lookups

This commit is contained in:
2026-03-18 23:20:10 -04:00
parent 336b80df39
commit 467c1464aa
7 changed files with 15 additions and 70 deletions

View File

@@ -454,34 +454,6 @@ bool WingUtils::SaveBlueprintPackage(UBlueprint* BP)
return bSuccess;
}// ============================================================
// FindClassByName
// ============================================================
UClass* WingUtils::FindClassByName(const FString& ClassName)
{
// Exact match first (handles both C++ classes and Blueprint _C classes)
for (TObjectIterator<UClass> It; It; ++It)
{
FString Name = It->GetName();
if (Name == ClassName || Name == ClassName + TEXT("_C"))
{
return *It;
}
}
// Case-insensitive fallback
for (TObjectIterator<UClass> It; It; ++It)
{
FString Name = It->GetName();
if (Name.Equals(ClassName, ESearchCase::IgnoreCase) ||
Name.Equals(ClassName + TEXT("_C"), ESearchCase::IgnoreCase))
{
return *It;
}
}
return nullptr;
}
// ============================================================
// Material helpers