Fix play mode runtime scene replacement

This commit is contained in:
2026-04-08 00:33:50 +08:00
parent 69cb80ccd4
commit 23ff4004f4
9 changed files with 149 additions and 0 deletions

View File

@@ -28,9 +28,14 @@ public:
bool ResumePlay(IEditorContext& context);
bool StepPlay(IEditorContext& context);
::XCEngine::Components::Scene* GetRuntimeScene() const { return m_runtimeLoop.GetScene(); }
private:
void ResetRuntimeInputBridge();
void ApplyGameViewInputFrame(float deltaTime);
void EnsureRuntimeSceneSyncSubscription(IEditorContext& context);
void ClearRuntimeSceneSyncSubscription(IEditorContext& context);
void SyncRuntimeSceneIfNeeded(IEditorContext& context);
uint64_t m_playStartRequestedHandlerId = 0;
uint64_t m_playStopRequestedHandlerId = 0;
@@ -38,6 +43,7 @@ private:
uint64_t m_playResumeRequestedHandlerId = 0;
uint64_t m_playStepRequestedHandlerId = 0;
uint64_t m_gameViewInputFrameHandlerId = 0;
uint64_t m_runtimeSceneChangedHandlerId = 0;
SceneSnapshot m_editorSnapshot = {};
GameViewInputFrameEvent m_pendingGameViewInput = {};
GameViewInputFrameEvent m_appliedGameViewInput = {};