• Unity3d GUI适应分辨率


    float sourceWidth = 1024f;
        float sourceHeight = 768f;
        float m_fScaleWidth;
        float m_fScaleHeight;
    
        void OnGUI()
        {
            m_fScaleWidth = Screen.width / sourceWidth;
            m_fScaleHeight = Screen.height / sourceHeight;
            GUI.matrix = Matrix4x4.TRS(new Vector3(0, 0, 0), Quaternion.identity,new Vector3(m_fScaleWidth, m_fScaleHeight, 1));
    
            GUI.Button(new Rect(0, 0, 1024, 768), "");
        }

  • 相关阅读:
    Xshell6配置ssh免密码登录虚拟机
    编程语言的各种区别
    unity_小功能实现(敌人追踪主角)
    unity_小功能实现(敌人巡逻功能)
    Unity Editor已停止工作
    unity之初级必备知识
    unity之中级工程师
    iTween基础之功能简介
    C#数据结构_查找
    C#数据结构_排序
  • 原文地址:https://www.cnblogs.com/ldxsuanfa/p/10713104.html
  • Copyright © 2020-2023  润新知