https://wiki.unrealengine.com/UMG,_Referencing_UMG_Widgets_in_Code
你是不是忘了官方文档中的第一步
1. Adding Modules:
in order to use UMG in C++ you need to Add the following Modules in ProjectNameBuild.CS file
"UMG", "Slate", "SlateCore
In this line:
//ProjectNameBuild.CS
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "UMG", "Slate", "SlateCore" });
|