【Unity】监听GameView分辨率变化

来源:互联网 发布:校园谈论源码 编辑:程序博客网 时间:2024/05/02 00:21

原文地址:http://weibo.com/819881121?from=myfollow_all&is_all=1#_rnd1455674673856


using UnityEngine;using System.Collections;[ExecuteInEditMode]public class GameViewTest : MonoBehaviour{    private float lastwidth = 0f;    private float lastheight = 0f;    private void OnGUI()    {        if (lastwidth != Screen.width || lastheight != Screen.height)        {            lastwidth = Screen.width;            lastheight = Screen.height;            print("Resolution :" + Screen.width + " X" + Screen.height);        }    }}


0 0
原创粉丝点击