UGameViewFunctionLibrary::CanToggleGameView

Only works in editor builds.