/// <summary> /// Per frame update. /// </summary> private void Update() { if (Input.GetKeyDown(KeyCode.LeftAlt)) { isLeftAltKeyDown = true; } if (Input.GetKeyDown(KeyCode.RightAlt)) { isRightAltKeyDown = true; } if (Input.GetKeyUp(KeyCode.LeftAlt)) { isLeftAltKeyDown = true; } if (Input.GetKeyUp(KeyCode.RightAlt)) { isRightAltKeyDown = true; } if ((isLeftAltKeyDown || isRightAltKeyDown) && Input.GetKeyDown(KeyCode.Return)) { if (Screen.fullScreen) { ResolutionUtility.ScaleToWindow(); } else { ResolutionUtility.ScaleToFullScreen(); } } }
/// <summary> /// Initialization. /// </summary> private void Start() { // Set to window on startup. ResolutionUtility.ScaleToWindow(); }