Add Engine.FocusGameViewport to implement game menu with camera focus gather

This commit is contained in:
Wojciech Figat
2022-08-01 16:17:34 +02:00
parent 1d7e88635f
commit 7953f6cb83
7 changed files with 66 additions and 10 deletions

View File

@@ -409,6 +409,19 @@ JsonAsset* Engine::GetCustomSettings(const StringView& key)
return Content::LoadAsync<JsonAsset>(assetId);
}
void Engine::FocusGameViewport()
{
#if USE_EDITOR
Editor::Managed->FocusGameViewport();
#else
if (MainWindow)
{
MainWindow->BringToFront();
MainWindow->Focus();
}
#endif
}
bool Engine::HasGameViewportFocus()
{
#if USE_EDITOR