Much better handling of type lookups
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user