You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
842 B
37 lines
842 B
3 years ago
|
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;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
}
|