コード例 #1
0
ファイル: GUI.cs プロジェクト: kmlkmljkl2/Anarchy
        public static void SelectionGrid(Rect position, Setting <int> value, string[] labels, int xCount)
        {
            int koeff = (int)(labels.Length / xCount);

            position.height = (position.height * koeff) + (Style.VerticalMargin * koeff - Style.VerticalMargin);
            value.Value     = UGUI.SelectionGrid(position, value.Value, labels, xCount, Style.SelectionGrid);
        }
コード例 #2
0
ファイル: GUI.cs プロジェクト: Lineyka/Anarchy
        public static void SelectionGrid(SmartRect position, Setting <int> value, string[] labels, int xCount, bool move = false)
        {
            float old   = position.height;
            int   koeff = (int)(labels.Length / xCount);

            position.height = (old * koeff) + (Style.VerticalMargin * koeff - Style.VerticalMargin);
            value.Value     = UGUI.SelectionGrid(position.ToRect(), value.Value, labels, xCount, Style.SelectionGrid);
            if (move)
            {
                position.MoveY();
            }
            position.height = old;
        }
コード例 #3
0
ファイル: GUILayout.cs プロジェクト: wensincai/Unity5.4
 public static int SelectionGrid(int selected, GUIContent[] contents, int xCount, GUIStyle style, params GUILayoutOption[] options)
 {
     return(GUI.SelectionGrid(GUIGridSizer.GetRect(contents, xCount, style, options), selected, contents, xCount, style));
 }