Hello dev, i would like to make something like that :
obviously, he doesn't compile. But, my questions :
Can we have template UClass ? If yes, how please ?
Did you see a design pattern for make something like that or a tips ?
Thank's for the read,
Have a nice day !
Code:
template <class T> UCLASS() class PROJECT_API AMyActor : public AActor { GENERATED_BODY() public: AMyActor(); UPROPERTY(EditDefaultsOnly) T* MyComponent = nullptr; } AMyActor<T>::AMyActor() { MyComponent = CreateDefaultSubobject<T>("MyComp"); } UCLASS() class PROJECT_API AMyChildActor : public AMyActor<USceneComponent> { GENERATED_BODY() }
Can we have template UClass ? If yes, how please ?
Did you see a design pattern for make something like that or a tips ?
Thank's for the read,
Have a nice day !
Comment