public void DrawFooter(Rect rect, ReorderableObjectList list)
            {
                float single  = rect.xMax;
                float single1 = single - 8f;

                if (list.onAddCallback != null)
                {
                    single1 = single1 - 25f;
                }
                if (list.onRemoveCallback != null)
                {
                    single1 = single1 - 25f;
                }
                rect = new Rect(single1, rect.y, single - single1, rect.height);
                Rect rect1 = new Rect(single1 + 4f, rect.y - 3f, 25f, 13f);
                Rect rect2 = new Rect(single - 29f, rect.y - 3f, 25f, 13f);

                if (Event.current.type == EventType.Repaint)
                {
                    this.footerBackground.Draw(rect, false, false, false, false);
                }
                if (list.onAddCallback != null)
                {
                    if (GUI.Button(rect1, this.iconToolbarPlus, this.preButton))
                    {
                        list.onAddCallback(list);
                    }
                }
                if (list.onRemoveCallback != null)
                {
                    EditorGUI.BeginDisabledGroup(list.index < 0 || list.index >= list.count);
                    if (GUI.Button(rect2, this.iconToolbarMinus, this.preButton))
                    {
                        list.onRemoveCallback(list);
                    }
                    EditorGUI.EndDisabledGroup();
                }
            }
Esempio n. 2
0
 public void DrawFooter(Rect rect, ReorderableObjectList list)
 {
     float single = rect.xMax;
     float single1 = single - 8f;
     if (list.onAddCallback != null)
     {
         single1 = single1 - 25f;
     }
     if (list.onRemoveCallback != null)
     {
         single1 = single1 - 25f;
     }
     rect = new Rect(single1, rect.y, single - single1, rect.height);
     Rect rect1 = new Rect(single1 + 4f, rect.y - 3f, 25f, 13f);
     Rect rect2 = new Rect(single - 29f, rect.y - 3f, 25f, 13f);
     if (Event.current.type == EventType.Repaint)
     {
         this.footerBackground.Draw(rect, false, false, false, false);
     }
     if (list.onAddCallback != null)
     {
         if (GUI.Button(rect1, this.iconToolbarPlus, this.preButton))
         {
             list.onAddCallback(list);
         }
     }
     if (list.onRemoveCallback != null)
     {
         EditorGUI.BeginDisabledGroup(list.index < 0 || list.index >= list.count);
         if (GUI.Button(rect2, this.iconToolbarMinus, this.preButton))
         {
             list.onRemoveCallback(list);
         }
         EditorGUI.EndDisabledGroup();
     }
 }