#554 C++中调用蓝图资产   asset     bp     c++     UE4     about a year ago (owner) Document
 UEditorUtilitySubsystem* EditorUtilitySubsystem = GEditor->GetEditorSubsystem<UEditorUtilitySubsystem>();
 if (EditorUtilitySubsystem)
 {
 	FAssetData SuraToolsAsset(
 		TEXT("/SuraControlPanel/SURA-ToolSets511"), // SURA-ToolSets511.uasset
 		TEXT("/SuraControlPanel"),
 		TEXT("SURA-ToolSets511"),
 		UEditorUtilityWidgetBlueprint::StaticClass()->GetClassPathName()
 	); // asset路径在编辑器里通过Reference Viewer可以获得
 	auto WidgetBP = CastChecked<UEditorUtilityWidgetBlueprint>(SuraToolsAsset.GetAsset());
 	if (TabID == NAME_None)
 	{
 		EditorUtilitySubsystem->SpawnAndRegisterTabAndGetID(WidgetBP, TabID);
 	}
 	else
 	{
 		if (EditorUtilitySubsystem->DoesTabExist(TabID))
 		{
 			EditorUtilitySubsystem->CloseTabByID(TabID);
 		}
 		else
 		{
                        EditorUtilitySubsystem->SpawnRegisteredTabByID(TabID);
 		}
 	}
 }
 
  • → + #481 FAssetData对象的创建   Slate   ...   about a year ago (owner) Document
  • → + #498 Interface在C++中的语法及使用 ...   about a year ago (owner) Document