I want to create a Blueprintable UClass, with a TSubclassOf UProperty, but then create a Blueprintable subclass of this UClass, which imposes further restrictions of the class of the UProperty, and restrict the list displayed in the editor.
i.e.
UCLASS(Abstract, Blueprintable)
class UBase : public UObject
{
GENERATED_BODY()
UPROPERTY(EditDefaultsOnly)
TSubclassOf<AActor> ActorType;
}
UCLASS()
class AAlphaActor : AActor
{
GENERATED_BODY()
}
UCLASS(Blueprintable)
class UAlpha : UBase
{
GENERATED_BODY()
Alpha()
{
// Enforce this in blueprints??
ActorType = AAlphaActor::StaticClass();
}
}
When I create a Blueprint of UAlpha, I want to be able to edit ActorType, but as if it were TSubclassOf rather than TSubclassOf.
As I understand the AllowedClasses meta value can be used with UClass* to restrict the types, is their a way to set this meta tag on the subclasses to achieve a similar restriction?
I also known I could use UObject::PostEditChangeProperty, to enforce this requirement, but this wouldn’t restrict the list displayed in editor.