/// <summary> /// 初期化・インスタンス生成. /// </summary> static public void Init( int fixWidth, int fixHeight ) { inst = new GameWindowSize(fixWidth, fixHeight); }
/// <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 }
public static Rect GetScaledRectWithoutSpace(Rect rect) { return(GameWindowSize.GetRectWithoutSpace(rect)); }
public static Rect GetScaledRectWithoutSpace(float x, float y, float w, float h) { return(GameWindowSize.GetRectWithoutSpace(x, y, w, h)); }
public static Rect GetScaledRect(Rect rect) { return(GameWindowSize.GetRect(rect)); }