目前知道的主要有两种方式
一种是只能在构造函数中
UStaticMeshComponent* com = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("test"));
com->SetupAttachment(RootComponent);
另一种是Runtime添加
com = NewObject<UStaticMeshComponent>(this, TEXT("ffff"));
AddInstanceComponent(com);