知识点记录
- Adding the Widget to the Viewportcpp
GEngine->GameViewport->AddViewportWidgetContent( SNew(MyWidgetPtr.ToSharedRef()) );
- 创建cpp
GEngine->GameViewport->AddViewportWidgetContent( SNew(SWeakWidget) .PossiblyNullContent(MyWidgetClass) );
- 创建并赋值cpp
GEngine->GameViewport->AddViewportWidgetContent( SAssignNew(MyWidgetPtr, SWeakWidget) .PossiblyNullContent(MyWidgetClass) );