Is there a keyboard shortcut to maximize the Game window in Unity in Play Mode?

Created a script to do the job that doesn’t need to be attached to a gameobject:

using UnityEditor;
using UnityEngine;

[InitializeOnLoad]
static class FullscreenShortcut
{
    static FullscreenShortcut()
    {
        EditorApplication.update += Update;
    }

    static void Update()
    {
#if UNITY_EDITOR
        if (EditorApplication.isPlaying && ShouldToggleMaximize())
        {
            EditorWindow.focusedWindow.maximized = !EditorWindow.focusedWindow.maximized;
        }
#endif
    }

    private static bool ShouldToggleMaximize()
    {
        return Input.GetKey(KeyCode.Space) && Input.GetKey(KeyCode.LeftShift);
    }
}

Leave a Comment