Handle mouse center/visible when editor play/pause/stop

This commit is contained in:
Sri Sham Haran 2023-03-05 21:33:05 +08:00
parent f4f544ff53
commit 9866c6e307
1 changed files with 1 additions and 1 deletions

View File

@ -619,7 +619,6 @@ namespace SHADE
} }
else if (editorState == State::PAUSE) else if (editorState == State::PAUSE)
{ {
SHWindow::SetMouseVisible(prevCursorVisibleState); SHWindow::SetMouseVisible(prevCursorVisibleState);
editorState = State::PLAY; editorState = State::PLAY;
} }
@ -636,6 +635,7 @@ namespace SHADE
editorState = State::PAUSE; editorState = State::PAUSE;
SHInputManager::SetMouseCentering(false); SHInputManager::SetMouseCentering(false);
prevCursorVisibleState = SHWindow::GetMouseVisible(); prevCursorVisibleState = SHWindow::GetMouseVisible();
SHWindow::SetMouseVisible(true);
SHEventManager::BroadcastEvent<SHEditorStateChangeEvent>(STATE_CHANGE_EVENT, SH_EDITOR_ON_PAUSE_EVENT); SHEventManager::BroadcastEvent<SHEditorStateChangeEvent>(STATE_CHANGE_EVENT, SH_EDITOR_ON_PAUSE_EVENT);
} }