Ejemplo n.º 1
0
    private void OnGUI_Line(string lineHeader, string lineTextWith, string lineTextWithout)
    {
        GUILayout.BeginVertical();

        GUILayout.BeginHorizontal();
        GUILayout.FlexibleSpace();
        GUILayout.Label(lineHeader, Master.styleTextHeader);
        GUILayout.FlexibleSpace();
        GUILayout.EndHorizontal();

        GUILayout.BeginVertical(Master.styleBoxGreyLineOnTop);

        int indent = Mathf.RoundToInt(DisplayMetricsUtil.DpToPixel(DisplayMetricsUtil.PixelToDp(Screen.width) / 8));

        GUILayout.BeginHorizontal(GUILayout.MaxHeight(0));
        OnGUI_LineColumn(lineTextWith, Master.styleBoxTorquise);
        GUILayout.FlexibleSpace();
        GUILayout.Label("", GUILayout.MinWidth(indent), GUILayout.Height(1));        // GUILayout.Height(1) it was not easy to find this solution for a not easy to understand problem
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        GUILayout.Label("", GUILayout.MinWidth(indent), GUILayout.Height(1));
        GUILayout.FlexibleSpace();
        OnGUI_LineColumn(lineTextWithout, Master.styleBoxRed);
        GUILayout.EndHorizontal();

        GUILayout.EndVertical();

        GUILayout.Label("", GUILayout.MinHeight(DisplayMetricsUtil.DpToPixel(5)));

        GUILayout.EndVertical();
    }
Ejemplo n.º 2
0
 public static int GetLongSideInDP()
 {
     return(DisplayMetricsUtil.PixelToDp(DisplayMetricsUtil.GetLongSide()));
 }