untiy切换界面窗口代码

using UnityEngine;
using System.Collections;

public class ScreenWindowa : MonoBehaviour
{
    int winNmu = 0;
	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
      
        if(winNmu==1)
        {
            Screen.SetResolution(1024,768,false);
            winNmu = 0;
        }
        else if(winNmu==2)
        {
            Screen.SetResolution(Screen.currentResolution.width-100, Screen.currentResolution.height - 100, false);
            winNmu = 0;
        }
        else if (winNmu == 3)
        {
            Screen.fullScreen = !Screen.fullScreen;
            winNmu = 0;
        }
        else 
        {
            return;
        }
	
	}
    void OnGUI() 
    {
        if (GUI.Button(new Rect(100, 100, 100, 100), "1024*768")) 
        {
            winNmu = 1;
        }
        else if(GUI.Button(new Rect(200,100,100,100),"1920*1080"))
        {
            winNmu = 2;
        }
        else if(GUI.Button(new Rect(300,100,100,100),"fullscreen"))
        {
            winNmu = 3;
        }
    }
}

你可能感兴趣的:(window,切换)