using UnityEngine; using System.Collections; using ResolutionLibrary; using UnityEngine.UI; public class ScreenFull : MonoBehaviour { private bool isfullscreen; public static ScreenFull instance; void Awake() { if (instance == null) { instance = this; } } Resolution[] resolutions; float Height; float Width; public void TheWay() { if (!isfullscreen) { Height = Screen.height; Width = Screen.width; Screen.SetResolution(ResolutionLibrary.ScreenResolution.GetWidth(), ResolutionLibrary.ScreenResolution.GetHeight(), true); isfullscreen = true; } else { Screen.SetResolution((int)Width, (int)Height, false); isfullscreen = false; } } }