/// <summary>
 /// 初期化・インスタンス生成.
 /// </summary>
 static public void Init(
     int fixWidth,
     int fixHeight
     )
 {
     inst = new GameWindowSize(fixWidth, fixHeight);
 }
Exemple #2
0
        /// <summary>
        /// GUI.
        /// </summary>
        void OnGUI()
        {
#if UNITY_EDITOR
            if (prevScreenW != Screen.width || prevScreenH != Screen.height)
            {
                GameWindowSize.ReCalc(LibBridgeInfo.FIXED_SCREEN_WI, LibBridgeInfo.FIXED_SCREEN_HI);
                foreach (GUIStyle style in GUI.skin)
                {
                    style.fontSize = (int)(20 * GameWindowSize.GameScreenScale);
                }
            }
            prevScreenW = (int)gameview.position.width;
            prevScreenH = (int)gameview.position.height;
#endif
        }
Exemple #3
0
 public static Rect GetScaledRectWithoutSpace(Rect rect)
 {
     return(GameWindowSize.GetRectWithoutSpace(rect));
 }
Exemple #4
0
 public static Rect GetScaledRectWithoutSpace(float x, float y, float w, float h)
 {
     return(GameWindowSize.GetRectWithoutSpace(x, y, w, h));
 }
Exemple #5
0
 public static Rect GetScaledRect(Rect rect)
 {
     return(GameWindowSize.GetRect(rect));
 }