コード例 #1
0
        private static float GetItemWidth(EditorToolbarItem item)
        {
            float itemWidth = item.GetItemWidth();

            if (item.GetType() == typeof(EditorToolbarButton) && itemWidth < Styles.STAND_BUTTON_WIDTH)
            {
                itemWidth = Styles.STAND_BUTTON_WIDTH;
            }
            return(itemWidth);
        }
コード例 #2
0
 public static void AddItem(EditorToolbarItem item, EditorToolbarOrientation orientation)
 {
     if (orientation == EditorToolbarOrientation.Left)
     {
         leftGroups.Add(EditorToolbarGroup.CreateGroup(item));
     }
     else if (orientation == EditorToolbarOrientation.Right)
     {
         rightGroups.Add(EditorToolbarGroup.CreateGroup(item));
     }
 }
コード例 #3
0
        internal static EditorToolbarGroup CreateGroup(EditorToolbarItem item)
        {
            if (item == null)
            {
                return(null);
            }

            if (item.GetType() == typeof(EditorToolbarButton))
            {
                return(new EditorToolbarGroup(new EditorToolbarButton[] { item as EditorToolbarButton }));
            }
            else if (item.GetType() == typeof(EditorToolbarToggleButton))
            {
                return(new EditorToolbarGroup(new EditorToolbarToggleButton[] { item as EditorToolbarToggleButton }));
            }

            return(null);
        }
コード例 #4
0
 public static void RemoveItem(EditorToolbarItem item, EditorToolbarOrientation orientation)
 {
 }