UNITY更改启动窗口尺寸

来源:互联网 发布:js函数数组参数传递 编辑:程序博客网 时间:2024/06/11 14:21
void Awake()
{
        DontDestroyOnLoad(this.gameObject);
        
#if UNITY_STANDALONE_WIN && !UNITY_EDITOR
        OnWinInitSize();

#endif


 void OnWinInitSize()
    {
        int settingSizeX = Screen.width;
        int settingSizeY = Screen.height;
        
        if (settingSizeY == 480)
        {
            Screen.SetResolution(640, 361, false);
        }
    }

0 0