示例#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
 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));
 }