我找到一些接口,但没法使用,比如:
for (FEditorViewportClient* ViewportClient : GEditor->GetAllViewportClients())
{
// 检查视口是否有效并且是主视口
if (ViewportClient && ViewportClient->IsPerspective())
ViewportClient->GetCameraPosition(CameraLocation, CameraRotation);
这段代码里的GEditor 和 IsPerspective都提示无法解析的外部符号,
include “Editor/UnrealEd/Public/UnrealEdGlobals.h”
include “Editor/UnrealEd/Classes/Editor/EditorEngine.h”
include “Editor/UnrealEd/Public/Editor.h”
该加的头文件也加了。
求教,该怎么获取编辑器模式下(未运行游戏),获取当前游戏视口的世界坐标