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); }
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; }
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)); }