PIE: viewport-embedded playback with UE-style main toolbar

Play no longer switches to fullscreen direct rendering: PIE now keeps
the editor UI alive and renders the primary camera into the Viewport
panel (new SceneRenderer::SetGameView flag; kDisplayDirect stays a
manual fullscreen preview for later release form). Editor camera stops
being driven during PIE, and viewport click-pick is gated off while
playing (clicks are game input now).

The Play/Stop buttons move out of the menu bar into a dedicated main
toolbar row below it (centered, UE Main Toolbar semantics): green Play
when idle; Pause (yellow, highlighted while paused) + Stop (orange)
while playing. Ctrl+P hotkey kept. Stats "Pause Simulation" merged
into the toolbar Pause; viewport overlay shows PAUSED accordingly.
This commit is contained in:
2026-10-05 11:14:24 +08:00
parent 5ca5ac2a1e
commit 1a278d5945
10 changed files with 167 additions and 67 deletions
+4 -3
View File
@@ -269,12 +269,13 @@ namespace Engine
ubo.prevView = m_LastView;
ubo.prevProj = m_LastProjNoJitter;
// ---- 1. 相机:渲染源按显示模式分派(UE 语义)。编辑器形态
// ---- 1. 相机:渲染源按形态分派(UE 语义)。编辑器形态
// Scene view 恒用编辑器相机(视口 UI 状态,空场景可用);
// 游戏形态用场景 primary 相机实体(游戏逻辑所有)----
// 游戏形态(kDisplayDirect 全屏预览或 PIE 内嵌播放)用
// 场景 primary 相机实体(游戏逻辑所有)----
ECS::TransformComponent* camTransform = nullptr;
const Camera* camera = nullptr;
if (m_DisplayMode == kDisplayViewport) {
if (m_DisplayMode == kDisplayViewport && !m_GameView) {
camTransform = &m_EditorCamera.GetTransform();
camera = &m_EditorCamera.GetController();
} else if (auto* cameraComp = scene.GetPrimaryCamera(&camTransform)) {