// Copyright Epic Games, Inc. All Rights Reserved. #include "LyraWidgetFactory_Class.h" #include "Blueprint/UserWidget.h" #include "UObject/Class.h" #include "UObject/Object.h" TSubclassOf ULyraWidgetFactory_Class::FindWidgetClassForData_Implementation(const UObject* Data) const { // Starting with the current class, work backwards to see if there are any construction rules for this class. for (UClass* Class = Data->GetClass(); Class; Class = Class->GetSuperClass()) { TSoftClassPtr ClassPtr(Class); if (const TSubclassOf EntryWidgetClassPtr = EntryWidgetForClass.FindRef(ClassPtr)) { return EntryWidgetClassPtr; } } return TSubclassOf(); }