/// <summary>
        /// Toggles fullscreen. Fullscreen uses native resolution, windowed uses a default resolution.
        /// </summary>
        public void OnFullscreenToggle()
        {
            // Ensure this togglebox isn't triggered by attempts to fullscreen with Alt-Enter
            if (Input.GetKeyDown(KeyCode.Return) || Input.GetKeyDown(KeyCode.KeypadEnter))
            {
                if (Input.GetKey(KeyCode.LeftAlt))
                {
                    return;
                }
            }

            displaySettings.SetFullscreen(fullscreenToggle.isOn);
        }
Example #2
0
 private void Set(bool on)
 {
     toggle.isOn = on;
     display.SetFullscreen(on);
 }